Solved

Differences between java.exe in jdk/bin and jdk/jre/bin.

Posted on 2004-09-28
19
872 Views
Last Modified: 2013-11-23
What is the difference between java.exe in the jdk/bin directory, and java.exe in the jdk/jre/bin directory?. I'm using java 1.5, and I get a java.lang.UnsupportedClassVersionError with the 1st one, and with the 2nd one works ok.
0
Comment
Question by:pulupul
  • 7
  • 6
  • 5
  • +1
19 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12175643
You've probably got different VMS in that case

java xx\java.exe -version
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12175648
LOL i mean

xx\java.exe -version
0
 
LVL 92

Expert Comment

by:objects
ID: 12175649
should be the same, do you have another jdk/jre installed?
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 3

Author Comment

by:pulupul
ID: 12175656
Sorry forget it, there must be a problem with my path, because I get the same result if I reference java.exe with the full path.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12175658
You'll probably find you're trying to run a 1.5 class with a 1.4 VM
0
 
LVL 3

Author Comment

by:pulupul
ID: 12175667
The case is that I have java 1.4 installed also, but the path does not reference its directory, I must be missing something.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12175682
How are you starting / invoking it?
0
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
ID: 12175683
> The case is that I have java 1.4 installed also,

it won't run 1.5 classes, thats the reason for the error

> but the path does not reference its directory

thats right, it runs it from windows directory
0
 
LVL 3

Author Comment

by:pulupul
ID: 12175685
OK i found it, there is a java.exe in \windows\system32 which is version 1.4.2 :)
0
 
LVL 92

Expert Comment

by:objects
ID: 12175701
(:
0
 
LVL 3

Author Comment

by:pulupul
ID: 12175704
I'd better definitely uninstall 1.4.2.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12175718
pulpul

a.
>>it won't run 1.5 classes, thats the reason for the error

i already said this:

>>You'll probably find you're trying to run a 1.5 class with a 1.4 VM

and

b.

>>
> but the path does not reference its directory

thats right, it runs it from windows directory
>>

is a contradiction in terms

Please explain why you accepted that as the answer





0
 
LVL 3

Author Comment

by:pulupul
ID: 12175804
Sure: I didn't know why was I executing 1.4 VM instead of 1.5, because I thought that the only one that was on my path was 1.5.
Statement b, strictly speaking, is a contradiction, but the case is that I didn't know Java installed had put a java.exe in the windows directory, and objects guessed that.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12175832
Not convinced, and FYI

>>it won't run 1.5 classes

is actually incorrect

0
 
LVL 3

Author Comment

by:pulupul
ID: 12175863
why?
0
 
LVL 92

Expert Comment

by:objects
ID: 12175878
It's not incorrect (o/wise why would u get the error), though I'm sure CEHJ will twist the semantics to make it appear wrong :)

0
 
LVL 20

Expert Comment

by:Venabili
ID: 12177255
objects,

I thought I had asked to stop the personal remarks... And I thought you said OK.

guys,

Want to calm down?

Venabili
Java Page Editor
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12177790
>>why?

Sorry - it was very late here when i posted that - it wasn't precise. What i meant to say is that because a class has been compiled with 1.5 doesn't mean that it won't run on a 1.4 VM as long as the target version has been set correctly.
0
 
LVL 92

Expert Comment

by:objects
ID: 12177798
> What i meant to say is that because a class has been compiled with 1.5 doesn't mean that it won't run on a
> 1.4 VM as long as the target version has been set correctly.

Then it would not be a 1.5 class file.
My original statement is correct.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Basic Java Case or If-Else statement... 3 50
fibonacci ten numbers 4 38
servlet example 17 28
null output 3 24
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now