• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java 5 as jre1.3

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can i run a program on Java 5 jvm but as 1.3
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, what does the -version:<> does.
Does it run current jre as target version
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic