• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

running jar file crearted by 1.6 on 1.5

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jar file which was created using java 1.6 . Now I want to run this using java 1.5 can I run this using java 1.5 ?
 
Sheriff
Posts: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. Java tries to be backward compatible, so a 1.6 JVM should be able to run classes compiled by a Java 1.5 compiler. The reverse is not true.
 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My project has a third party jar file which is complied by 1.6, my project I am creating a jar file this jar file I want to run on java 1.5 , please advice me how can I use the thirdparty jar built using 1.6 in my project which uses 1.5

Please advice.

 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't use those Classes, since the VM has no idea if there are API changes in the 1.6 that will not work on 1.5.

The opposite is true as already mentioned.

WP
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it open source? If so try to build it from the source using 1.5. It is probable though that they use 1.6 classes which would mean you might have to change a thing or two to make it work.
 
Greg Charles
Sheriff
Posts: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been going through this a lot recently because I'm working on a project where I'm forced to use a Java 1.4 VM. (No, I'm not kidding. I wish I were.) I recently was able to find a relatively new vintage of Mockito that's separately maintained as JDK 1.4 compatible by a volunteer (bless him!) If you can't find something like that for your third party jar, and recompiling it from the source yourself (as Bill suggested) isn't working out, then you might have to try getting an earlier version of it and hope your project is not using the new features.

Another option is just upgrading your project to use Java 6. It's ridiculous to still be using Java 5, which is now years out of date. (Hello kettle, I'm pot. Pleased to meet you!)


By the way, here's a little utility that helps you figure out what Java version you will need for a given jar: http://code.google.com/p/versioncheck/
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic