I am having some difficulty.
I am trying to set the path on a machine, i have set Java_Home to C:\Program Files\Java\jdk1.4.2_01\bin
and Path to C:\Program Files\Java\jdk1.4开发者_JAVA技巧.2_01\bin;C:\Program Files\Common...
yet whenever i do java -version in cmd i get
Java(TM) 2 Runtime Environment, Standard Edition (build
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
any ideas why this might be?
Thanks
First, JAVA_HOME should be set (if it is set) to the root directory of the Java installation, or in your case
C:\Program Files\Java\jdk1.4.2_01
Second, JAVA_HOME is an older way of letting programs know where Java resides. It should be set more for "backwards compatibility" and less for "making it work".
The Path then should have an entry
${JAVA_HOME}\bin
And it is the additional "bin" on the path that will allow the executables to be found. Make sure that this java executable is found on your path first, and you will see a difference in output
Finally, unless you absolutely need Java 1.4, an upgrade is recommended.
You don't have to care about JAVA_HOME
as it is not needed to run Java. It's used by some applications.
Check your path for additional entries that contain a jdk/jre. Move your PATH values to the front of the current path.
If you've changed the PATH
environment variable in windows (through the dialogs), make sure that you spawn a new console because running consoles will not pick up global changes...
JAVA_HOME should be set to C:\Program Files\Java\jdk1.4.2_01, and the path should contain both C:\Program Files\Java\jdk1.4.2_01\bin and C:\Program Files\Java\jdk1.4.2_01\jre\bin
精彩评论