You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dave Inskeep <da...@bea.com> on 2000/11/21 22:40:54 UTC

registry JRE vs. JDK with java task

I'm trying to run a class with the java task from my own task and am 
confused about where the java task determines what JRE to use. After I run 
my app the property sun.boot.library.path reports that it's using jars from 
C:\Program Files\JavaSoft\JRE\1.2\lib\, which is not where my JAVA_HOME 
environment variable points to. My JAVA_HOME is pointing to 
d:\java\jdk1.2.2. Anyone have any idea where the heck the java task is 
getting this other JRE to use? I definitely do not want to use it, I want 
to use what my JAVA_HOME points to.

Thanks,
Dave


RE: registry JRE vs. JDK with java task

Posted by Conor MacNeill <co...@m64.com>.

> -----Original Message-----
> From: Bernd Donath [mailto:bdonath@bd-net.de]
> As far as I know the JAVA_HOME variable is
> no more required
> since JDK1.2...

Just to clarify. Ant requires JAVA_HOME to be set so that it can find
tools.jar which contains the javac compiler. So while the JDK may no
longer require it, it still needs to be set if you are using Javac in
ant.


Re: registry JRE vs. JDK with java task

Posted by Bernd Donath <bd...@bd-net.de>.
I made the same experience with Oracle. The reason is that Oracle updates the 
global PATH settings under Windows so that their JVM (runtime and JDK)
is BEFORE the one from Sun. If you use the latest SUN JVM under windows
(at present 13.0.-01) some small startup wrappers will be added to 
WINDIR\SYSDIR (i.e. C:\WINNT\System32). Adjust your PATH so that the
WINDIR\SYSDIR path is before the Oracle path and you will have no problems.
You can check the JVM version you have currently set with the command:
"java -version".  As far as I know the JAVA_HOME variable is no more required 
since JDK1.2...

Bernd


> I got around this by using execute task instead of java task and giving the
> explicit path to java, i.e. JAVA_HOME\bin\java for my executable.
> Strangely, JAVA_HOME\bin is in my path before anything else javaish. Not
> quite what I wanted to do, but it works for now. Perhaps the java task has
> a way to set the JAVA_HOME that I missed or something? I try not to jump
> into the ant code (it violates my role as a user, though it pleases me the
> developer ;) but this time I think I will.
>
> I remember after installing Oracle one time that my version had rolled back
> to 1.1.7, I think javac puked. This machine doesn't have Oracle on it
> though (yet).
>
> As far as JDK vs. JRE, most definitely we want JDK's. We especially want
> our developers to be able to switch JDK versions and suppliers by changing
> their JAVA_HOME and PATH to point to different JDK's.
>
> Thanks,
> Dave
>
> At 02:42 PM 11/21/00 -0800, you wrote:
> >We had a similar problem. The Windows registry had been updated by an
> >install of another product that set something
> >HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java DevelopmentKit/CurrentVersion to
> >1.1.7 (as opposed to the 1.3 that it had been before). Check your registry
> >and see if that might be a problem.
> >
> >That said, you don't want (I think) to be using a jre at all. The jre's
> >don't include the compiler, jar tool, etc. You want one of the JDKs.
> >
> >
> >George McKinney, Developer
> >tantalus communications inc.
> >500-1122 Mainland Street
> >Vancouver, BC, Canada V6B 5L1
I> >george@tantalus.com
> >
> >Direct  604.726.6753
> >Main    604.609.0700
> >Fax     604.609.0705
> >www.tantalus.com
> >"When eBusiness experience counts."
> >
> > > -----Original Message-----
> > > From: Dave Inskeep [mailto:dave.inskeep@bea.com]
> > > Sent: Tuesday, November 21, 2000 1:41 PM
> > > To: ant-user@jakarta.apache.org
> > > Subject: registry JRE vs. JDK with java task
> > >
> > >
> > > I'm trying to run a class with the java task from my own task and am
> > > confused about where the java task determines what JRE to
> > > use. After I run
> > > my app the property sun.boot.library.path reports that it's
> > > using jars from
> > > C:\Program Files\JavaSoft\JRE\1.2\lib\, which is not where my
> > > JAVA_HOME
> > > environment variable points to. My JAVA_HOME is pointing to
> > > d:\java\jdk1.2.2. Anyone have any idea where the heck the
> > > java task is
> > > getting this other JRE to use? I definitely do not want to
> > > use it, I want
> > > to use what my JAVA_HOME points to.
> > >
> > > Thanks,
> > > Dave

RE: registry JRE vs. JDK with java task

Posted by Dave Inskeep <da...@bea.com>.
I got around this by using execute task instead of java task and giving the 
explicit path to java, i.e. JAVA_HOME\bin\java for my executable. 
Strangely, JAVA_HOME\bin is in my path before anything else javaish. Not 
quite what I wanted to do, but it works for now. Perhaps the java task has 
a way to set the JAVA_HOME that I missed or something? I try not to jump 
into the ant code (it violates my role as a user, though it pleases me the 
developer ;) but this time I think I will.

I remember after installing Oracle one time that my version had rolled back 
to 1.1.7, I think javac puked. This machine doesn't have Oracle on it 
though (yet).

As far as JDK vs. JRE, most definitely we want JDK's. We especially want 
our developers to be able to switch JDK versions and suppliers by changing 
their JAVA_HOME and PATH to point to different JDK's.

Thanks,
Dave

At 02:42 PM 11/21/00 -0800, you wrote:
>We had a similar problem. The Windows registry had been updated by an
>install of another product that set something
>HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java DevelopmentKit/CurrentVersion to
>1.1.7 (as opposed to the 1.3 that it had been before). Check your registry
>and see if that might be a problem.
>
>That said, you don't want (I think) to be using a jre at all. The jre's
>don't include the compiler, jar tool, etc. You want one of the JDKs.
>
>
>George McKinney, Developer
>tantalus communications inc.
>500-1122 Mainland Street
>Vancouver, BC, Canada V6B 5L1
>george@tantalus.com
>
>Direct  604.726.6753
>Main    604.609.0700
>Fax     604.609.0705
>www.tantalus.com
>"When eBusiness experience counts."
>
>
> > -----Original Message-----
> > From: Dave Inskeep [mailto:dave.inskeep@bea.com]
> > Sent: Tuesday, November 21, 2000 1:41 PM
> > To: ant-user@jakarta.apache.org
> > Subject: registry JRE vs. JDK with java task
> >
> >
> > I'm trying to run a class with the java task from my own task and am
> > confused about where the java task determines what JRE to
> > use. After I run
> > my app the property sun.boot.library.path reports that it's
> > using jars from
> > C:\Program Files\JavaSoft\JRE\1.2\lib\, which is not where my
> > JAVA_HOME
> > environment variable points to. My JAVA_HOME is pointing to
> > d:\java\jdk1.2.2. Anyone have any idea where the heck the
> > java task is
> > getting this other JRE to use? I definitely do not want to
> > use it, I want
> > to use what my JAVA_HOME points to.
> >
> > Thanks,
> > Dave
> >


RE: registry JRE vs. JDK with java task

Posted by George McKInney <ge...@tantalus.com>.
We had a similar problem. The Windows registry had been updated by an
install of another product that set something
HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java DevelopmentKit/CurrentVersion to
1.1.7 (as opposed to the 1.3 that it had been before). Check your registry
and see if that might be a problem.

That said, you don't want (I think) to be using a jre at all. The jre's
don't include the compiler, jar tool, etc. You want one of the JDKs.


George McKinney, Developer
tantalus communications inc.
500-1122 Mainland Street
Vancouver, BC, Canada V6B 5L1
george@tantalus.com

Direct  604.726.6753
Main    604.609.0700
Fax     604.609.0705
www.tantalus.com
"When eBusiness experience counts."


> -----Original Message-----
> From: Dave Inskeep [mailto:dave.inskeep@bea.com]
> Sent: Tuesday, November 21, 2000 1:41 PM
> To: ant-user@jakarta.apache.org
> Subject: registry JRE vs. JDK with java task
>
>
> I'm trying to run a class with the java task from my own task and am
> confused about where the java task determines what JRE to
> use. After I run
> my app the property sun.boot.library.path reports that it's
> using jars from
> C:\Program Files\JavaSoft\JRE\1.2\lib\, which is not where my
> JAVA_HOME
> environment variable points to. My JAVA_HOME is pointing to
> d:\java\jdk1.2.2. Anyone have any idea where the heck the
> java task is
> getting this other JRE to use? I definitely do not want to
> use it, I want
> to use what my JAVA_HOME points to.
>
> Thanks,
> Dave
>