• 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

Application requiring different JVMs

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have applications that require different JVMs. What should I do? (1.3.1 and 1.4.2)
Thanks
Pete
 
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you should not need two JVMs. What do you need 1.3.1 for?
[ March 17, 2005: Message edited by: Nick George ]
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to answer a big WHY???
 
Peter Lenzen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So JVM 1.4.2 is backward compatibible with 1.3.1 code? I know 1.5 is not. What can I do if I want to run an app that uses 1.3.1 and I also want work with 1.5 on my machine?

Thanks
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter,

So JVM 1.4.2 is backward compatibible with 1.3.1 code? I know 1.5 is not.



You cannot rely on backward compatibility; more so if you have a large-scale application. For example, I have an application developed using JDK 1.2 containing method name assert, which definitely makes the compiler grumble every time I try to compile it. Then there are deprecation issues you need to deal with.

What can I do if I want to run an app that uses 1.3.1 and I also want work with 1.5 on my machine?



Not sure if I understand you right here. You CAN have two JDK's in your machine and use any one for compiling and/or running your application based on the compile-time and run-time criteria you provide.

Regards,
Saket
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In theory, any app that runs on 1.3 runs just fine on 1.4, and any app that runs on 1.3 or 1.4 also runs just fine on 1.5. But of course in theory, there's no difference between theory and practice, but in practice, there is. Some large, complex applications may work on 1.3 and not work on a later JVM only because they either exploit or work around bugs that are fixed in later versions. The best thing to do is to try running everything on 1.4 or 1.5 and see what happens.

In any case, running multiple JVM versions on one machine won't be a problem on Linux or Solaris. On Windows, there are some potential issues with interfering registry keys, but this tends only to effect the Java Plug-in.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In response to what Saket writes: yes, later compiler versions will tend to complain about code written for earlier versions, for various reasons. You only see these warnings if you're compiling the code. If you're compiling the code, though, then you must be actively developing it, so then why not simply update it? If you're just running the apps, you won't see any compiler warnings, because it's already compiled. If you are compiling the code and the warnings make you queasy, you can just use the -source switch to tell the compiler about the vintage of the code.

Sun has never, not a single time, deprecated a method and then removed it. There are several instances, though, where once-deprecated methods have been undeprecated in a later release.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In theory, any app that runs on 1.3 runs just fine on 1.4, and any app that runs on 1.3 or 1.4 also runs just fine on 1.5. But of course in theory, there's no difference between theory and practice, but in practice, there i



I agree with Ernest. We had an application running on 1.3 version which did not work in 1.4. The reason was , we had out own implementation javax.sql.Connection object and the Connection i/f had changed in version 1.4. We had to implement the new methods of 1.4.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In contrast, I've ported an application from 1.3 to 1.4 (thousands of lines) that needed no changes at all.
When porting it to 1.5 later I only had to change a single variable name in a single class (someone had called something "enum" which is now a reserved word.

Well written code should work on higher level JVMs with no change once compiled.
Exploiting bugs is of course NOT what well written code does as doing so means reliance on non-documented behaviour (in fact that code would run on for example 1.3.0_04 but not on 1.3.0_05 or 1.3.1_02, not good).
Workarounds for bugs should still work in higher level JVMs unless they exploit the bug itself (by doing something to the buggy result) rather than replacing the buggy code with something else.
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're looking for a way to specify the JVM requirements for your application, you might look into launching your app via Java WebStart. Within your JNLP file, you can specify what JVM version you need. Again, though, I'd be curious why you have an application which runs on a 1.3 JVM and not on a 1.4 JVM.
 
reply
    Bookmark Topic Watch Topic
  • New Topic