You could explicitly use the path to java/javaw if you want to make sure you're using a particular one, e.g. "C:\j2sdk1.4\bin\java.exe ...". I'm not sure if that works unless your JAVA_HOME environment variable is set to point to the 1.4 installation as well, though.
I don't think you can find out which JDK was used to compile the code. The best you can do is probably to look at the class file version of a class in that jar; that will tell you for which JDK it was compiled (which can be different from the JDK version used to compile it, due to the -target switch).
It is working with JDK 1.4 only if i change my JAVA_HOME to JDK 1.4 from JDK 1.3. But my project requires me to use JDK 1.3 and jar file need JDK 1.4
I do not want to change java_home again and again. Is there any other way by which i can execute my jar by JDK 1.4 without changing Java_home.
Joined: Mar 22, 2005
You don't mention what kind of jar file this is that you downloaded, but is there a chance you can get the source code for it and recompile it using JDK 1.3 (which might involve some porting effort, of course) ?