From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1FxJzu-00023i-69 for garchives@archives.gentoo.org; Mon, 03 Jul 2006 08:41:38 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k638ewvQ017736; Mon, 3 Jul 2006 08:40:58 GMT Received: from slimak.dkm.cz (slimak.dkm.cz [62.24.64.34]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k638evY6014518 for ; Mon, 3 Jul 2006 08:40:57 GMT Received: (qmail 36611 invoked by uid 0); 3 Jul 2006 08:40:55 -0000 Received: from r141.chello.upc.cz (HELO ?192.168.1.1?) (62.24.83.141) by slimak.dkm.cz with SMTP; 3 Jul 2006 08:40:55 -0000 Message-ID: <44A8D816.70407@seznam.cz> Date: Mon, 03 Jul 2006 10:40:54 +0200 From: Caster User-Agent: Thunderbird 1.5.0.4 (X11/20060605) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-java@gentoo.org MIME-Version: 1.0 To: gentoo-java@lists.gentoo.org Subject: Re: [gentoo-java] specifying jvm in scripts? References: <44A8D4C9.4040707@cisco.com> In-Reply-To: <44A8D4C9.4040707@cisco.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: b581d0c8-a00d-4de2-b152-0c8b63cd4c9f X-Archives-Hash: c09762212d3ebabcba7ec2ea7eae7e14 Roy Wright wrote: > I have several java programs that I launch via scripts. Some are 1.4, > some are 1.5. > Just curious if there is a method to select the jvm from within the > script independent > of the system or user jvm? Something like: > > JAVACMD = `java-config --java 1.4` Yes, with GENTOO_VM and VMHANDLE of the jvm you want, like GENTOO_VM="sun-jdk-1.5" This will make all the wrapper scripts for java, javac, etc. call the binaries from selected VM. If your program also relies on JAVA_HOME, you can add this after the GENTOO_VM line: JAVA_HOME=$(java-config --jdk-home) Not sure how you can make it select "any of the 1.4 vm that's installed" though... Also there's some way for packages installed with portage to specify what VM they need, but I dont know the details, maybe somebody else... Caster -- gentoo-java@gentoo.org mailing list