Problem setting the default JRE

A

Author

If this has been asked many times, please don't get grouchy. I did
search and tried, but still failed.

Maybe I am having bad luck today, or maybe my system is too messy with
all kinds of JREs. I get stuck. I googled around, set all kinds of
paths and classpaths, it just does not help.

OK, I installed java_ee_sdk-5_06-windows.exe on my XP pro box. I set
up JAVA_HOME and added the jdk\bin folder to the PATH variable.

javac -version shows me 1.6.0_10

but, java -version still shows me 1.4.2_04.

It looks like this workstation has Sybase and Oracle which are using
the older JREs. I don't wanna remove all of these. But how can I
successfully set up the default JRE to 1.6. I've read the instruction
at java.sun.com and have made a few attempts, but failed.

Pasted below is the path setup info, which help you guys help me. Any
hint is appreciated.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Users\username>javac -version
javac 1.6.0_10

C:\Users\username>java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Users\username>path
PATH=C:\Sun\SDK\JDK;
C:\oracle\ora92\bin;
C:\oracle\ora92\jre\1.4.2\bin\client;
C:\oracle\ora92\jre\1.4.2\bin;
C:\Program Files\Oracle\jre\1.3.1\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\system32\WBEM;
C:\Program Files\Common Files\Roxio Shared\DLLShared\;
C:\Sybase\DLL;C:\Sybase\BIN;
C:\Program Files\Sybase\Sybase Central\win32;
C:\Sybase\ASEP;
C:\Program Files\QuickTime\QTSystem\;
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;
C:\Program Files\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE
\;
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
\PrivateAssemblies\

C:\Users\username>echo %java_home%
C:\Sun\SDK\jdk
 
L

Lew

If this has been asked many times, please don't get grouchy. I did
search and tried, but still failed.

Maybe I am having bad luck today, or maybe my system is too messy with
all kinds of JREs.  I get stuck. I googled around, set all kinds of
paths and classpaths, it just does not help.

OK, I installed java_ee_sdk-5_06-windows.exe on my XP pro box.  I set
up JAVA_HOME and added the jdk\bin folder to the PATH variable.

javac -version shows me 1.6.0_10

but, java -version still shows me 1.4.2_04.

It looks like this workstation has Sybase and Oracle which are using
the older JREs.  I don't wanna remove all of these.  But how can I
successfully set up the default JRE to 1.6.  I've read the instruction
at java.sun.com and have made a few attempts, but failed.

Pasted below is the path setup info, which help you guys help me.  Any
hint is appreciated.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Users\username>javac -version
javac 1.6.0_10

C:\Users\username>java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Users\username>path
PATH=C:\Sun\SDK\JDK;

This is not a directory that contains executables.

You want to put %JAVA_HOME%\bin in your PATH.
C:\oracle\ora92\bin;
C:\oracle\ora92\jre\1.4.2\bin\client;
C:\oracle\ora92\jre\1.4.2\bin;
C:\Program Files\Oracle\jre\1.3.1\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;
...

C:\Users\username>echo %java_home%

This environment variable is supposed to be spelled in all upper-case
letters.
 
K

Knute Johnson

Author said:
If this has been asked many times, please don't get grouchy. I did
search and tried, but still failed.

Maybe I am having bad luck today, or maybe my system is too messy with
all kinds of JREs. I get stuck. I googled around, set all kinds of
paths and classpaths, it just does not help.

OK, I installed java_ee_sdk-5_06-windows.exe on my XP pro box. I set
up JAVA_HOME and added the jdk\bin folder to the PATH variable.

javac -version shows me 1.6.0_10

but, java -version still shows me 1.4.2_04.

It looks like this workstation has Sybase and Oracle which are using
the older JREs. I don't wanna remove all of these. But how can I
successfully set up the default JRE to 1.6. I've read the instruction
at java.sun.com and have made a few attempts, but failed.

Pasted below is the path setup info, which help you guys help me. Any
hint is appreciated.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Users\username>javac -version
javac 1.6.0_10

C:\Users\username>java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Users\username>path
PATH=C:\Sun\SDK\JDK;
C:\oracle\ora92\bin;
C:\oracle\ora92\jre\1.4.2\bin\client;
C:\oracle\ora92\jre\1.4.2\bin;
C:\Program Files\Oracle\jre\1.3.1\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\system32\WBEM;
C:\Program Files\Common Files\Roxio Shared\DLLShared\;
C:\Sybase\DLL;C:\Sybase\BIN;
C:\Program Files\Sybase\Sybase Central\win32;
C:\Sybase\ASEP;
C:\Program Files\QuickTime\QTSystem\;
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;
C:\Program Files\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE
\;
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
\PrivateAssemblies\

C:\Users\username>echo %java_home%
C:\Sun\SDK\jdk

You never need JAVA_HOME on windows. You almost never need to set the
CLASSPATH environment variable.

It appears that you have at least two JDKs installed and at least two
JREs. Here is what I would do;

1) Go to Add/Remove Programs and remove all JDKs and JREs.

2) Restart your computer (ignore any Java warnings)

3) Install one JDK (preferably a recent one)

4) Go into the System Properties, Advanced Tab and clean out all PATH
statements that point to removed stuff and then add a path to your
JDK/bin directory. If you have any CLASSPATH statements, I'd get rid of
those too unless you have some specific library installed that requires it.

If there are some JREs installed with specific software, this should not
affect them.

Now you should be good to go.
 
R

Roedy Green

If this has been asked many times, please don't get grouchy. I did
search and tried, but still failed.

go into the control panel and look for Java.

Uninstall any Java versions you are not using.

enable only one Java.

If that fails, uninstall everything, wipe out remains, and install
just one Java.

see http://mindprod.com/jgloss/jdk.html
for more detailed help.
--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP
 
A

Author

go into the control panel and look for Java.

Uninstall any Java versions you are not using.

enable only one Java.

If that fails, uninstall everything, wipe out remains, and install
just one Java.

seehttp://mindprod.com/jgloss/jdk.html
for more detailed help.
--
Roedy Green Canadian Mind Productshttp://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP

Many thanks to all of you. I combined what you guys shared and fixed
the problem.
 
A

Arne Vajhøj

Lew said:
This environment variable is supposed to be spelled in all upper-case
letters.

That is only for *nix compatibility.

Windows is not case sensitive here either.

Arne
 
A

Arne Vajhøj

Knute said:
You never need JAVA_HOME on windows.

I think you are missing some condition here.

There are most certainly apps that have startup scripts
that required JAVA_HOME also on Windows.

I assume you mean for running stuff with java command
or something similar.
You almost never need to set the
CLASSPATH environment variable.

That horrible thing should be avoided like the plague if possible.

Arne
 
L

Lew

Arne said:
That is only for *nix compatibility.

Windows is not case sensitive here either.

The fact that Windows conflates the cases is not, in my view, a reason for
spelling the envar in the wrong case. The JAVA_HOME envar is defined as an
upper-case thing, and Windows being stupid about it is not a reason for humans
to follow suit.
 
K

Knute Johnson

Arne said:
I think you are missing some condition here.

There are most certainly apps that have startup scripts
that required JAVA_HOME also on Windows.

I've never come across one but never is a long time.
I assume you mean for running stuff with java command
or something similar.
Yes.


That horrible thing should be avoided like the plague if possible.

Arne

Well actually I use one all the time for JMF. The default installation
on Windows sets up a classpath. It is benign most of the time.
 
L

Lew

Author said:
C:\Users\username>echo %java_home% [sic]
C:\Sun\SDK\jdk
Knute said:
You never need JAVA_HOME on windows [sic].
I think you are missing some condition here.

There are most certainly apps that have startup scripts
that required JAVA_HOME also on Windows.
Knute said:
I've never come across one but never is a long time.
Ant does not require it, but works better if it is defined.

JBoss requires it.

See also
Java location: The installer will use the registry or
the JAVA_HOME environment variable to determine the base
path of a J2SE 5[+] JRE.

Many installers look for JAVA_HOME.

And from Tomcat's RUNNING.txt, the doc on how to run Tomcat:
Set an environment variable named JRE_HOME to the pathname of
the directory into which you installed the JRE,
e.g. [sic] c:\jre5.0 ...
NOTE: You may also use the full JDK rather than just the JRE.
In this case set your JAVA_HOME environment variable to the
pathname of the directory into which you installed the JDK,
e.g. [sic] c:\j2sdk5.0 ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top