Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java 5 as jre1.3

 
Swapnil Shroff
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i run a program on Java 5 jvm but as 1.3
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your program was compiled using JDK 1.3 then it should run on a 1.5 JVM. Are you having a problem or is that not what you were asking ?
 
Balasubramanian Chandrasekaran
Ranch Hand
Posts: 215
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Swapnil Shroff:
How can i run a program on Java 5 jvm but as 1.3


I guess you are asking about running your class file under the JVM which you specify. If this is what you want then you can use


[ April 08, 2008: Message edited by: Balasubramanian Chandrasekaran ]
 
Swapnil Shroff
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes bala. I want to use java -version:<version-number>
however does the jvm require the target versioned VM also
 
Swapnil Shroff
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, what does the -version:<> does.
Does it run current jre as target version
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "-version" option simply causes the JRE version to be printed; it does not cause any change in the way the JRE works.

It's not clear to me what you mean by "run as 1.3". As Joanne said, JREs are backwards-compatible: anything that ran on 1.3 should also run on 5. As far as I know, there's no way to get a newer JRE to behave like an older one. Why would you want that?
[ April 10, 2008: Message edited by: Ulf Dittmer ]
 
Swapnil Shroff
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "-version" option simply causes the JRE version to be printed; it does not cause any change in the way the JRE works.


I think -version option does more than that
From java command


JREs are backwards-compatible: anything that ran on 1.3 should also run on 5.


JRE 5 does not have assured compatibility with 1.3. I tried my code(its a legacy code with heavy swing/awt use) compiled on 1.3.1_19 to run on 1.5 but it gives me wired exceptions.

-version option gives a way to run code compiled with olderversion to run on latest version. I tried doing it eclipse and was successful . however I want to so similar thing on command prompt.

Thanks
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JRE 5 does not have assured compatibility with 1.3. I tried my code(its a legacy code with heavy swing/awt use) compiled on 1.3.1_19 to run on 1.5 but it gives me wired exceptions.

Interesting. What kind of exceptions? I suppose it's possible that the code used to work because of a bug on 1.3 that has since been fixed, or that there's a new bug in Java 5 that keeps correct code from running.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic