aspose file tools*
The moose likes Beginning Java and the fly likes My java and javac exes are running on different versions...[unsolved] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "My java and javac exes are running on different versions...[unsolved]" Watch "My java and javac exes are running on different versions...[unsolved]" New topic
Author

My java and javac exes are running on different versions...[unsolved]

Raghavan Chockalingam
Ranch Hand

Joined: Dec 20, 2005
Posts: 77
I earier had JDK 1.4.2 and now using JDK 1.5.0 . But somehow I do not know that javac is running with JDK 1.5.0 version compiler and java is running with JDK 1.4.2 java.exe. How can I tell the java.exe file to use JDK 1.5.0 java.exe file???

Here is something I observed....


[ January 03, 2006: Message edited by: Raghavan Chockalingam ]

[ January 03, 2006: Message edited by: Raghavan Chockalingam ]
[ January 04, 2006: Message edited by: Raghavan Chockalingam ]

Raghavan
SCJP 6
Praveena Jayanthi
Greenhorn

Joined: Dec 30, 2005
Posts: 10
You can use "java -version" at the command prompt to give you the version of java you are using.
Praveena Jayanthi
Greenhorn

Joined: Dec 30, 2005
Posts: 10
I am sorry for not completing my reply and it was submitted.

You could be having problems with PATH and CLASSPATH environment variables. The probable reason could be that you have appended the new path to java 1.5 but did not delete the prior path entry. So it always finds 1.4 first.
Raghavan Chockalingam
Ranch Hand

Joined: Dec 20, 2005
Posts: 77
I have already ran the command and the result is in the first post...pls look out for different versions reported by JVM...
Jeremy Botha
Ranch Hand

Joined: Feb 16, 2005
Posts: 125
Hi there

if you're running java under a windows environment, do the following:

click the start button, select 'run', hen type regedit and hit enter. This will launch the regedit program.

Browse through the keys till you find the key
HKEY_LOCAL_MACHINE/Software/Javasoft/Java Development Kit. Select this key in the left hand pane. In the right hand pane, ensure that CurrentVersion is set to 1.5. Also, check that you have a 1.5 key under the currently selected key in the tree.

Then, select the Java Runtime Environment key. Check this is also set to 1.5

What I suspect happened is that you installed the 1.4.x Development Kit, then installed the 1.5 Runtime Environment. From what I recall, javac runs from the development kit, and java runs from the Runtime environment by default

*shrugs* hope this helps.


McFinnigan? Never heard of him. Nobody here but us chickens...<br /> <br />SCJP for Java 1.4<br />SCJD for Java 5.0
Raghavan Chockalingam
Ranch Hand

Joined: Dec 20, 2005
Posts: 77
You are right...registry had full or 1.4.2 entries...I tried to replace them with 1.5.0 but did not work so I deleted all those 1.4.2 entries and installed jdk1.5.0 again now the registry has only 1.5.0 entries...

but I believe there is some problem lurking...cos when i try to run this program...it gives up this error...why is this error comin up..


Code for CreateTable.java
Mateus Hooker
Greenhorn

Joined: Jul 25, 2005
Posts: 4
Hi Raghavan,

This is a classpath issue. The class you are trying to run is not specified in your classpath.

See : http://www.dynamic-apps.com/tutorials/classpath.jsp

Hope this helps
omar bili
Ranch Hand

Joined: Aug 13, 2004
Posts: 177
Hi
you can set it in the envirement variables
which can be accessed from my computer -> propreties -> advanced -> envirement variables, edit the path variable and add:
<location where jdk 1.5 is installed> / bin ;
add it at the beginning of the path variable.
Omar
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Hi Raghavan,
If I were you I would invest the time in learning how to build and run your classes with ANT. Another tip would be to write unit tests for your classes and have ANT run the unit tests for you, so as to ensure that you logic is correct.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My java and javac exes are running on different versions...[unsolved]