• 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

RTFTemplate Jar giving "java.lang.UnsupportedClassVersionError: Bad version number in .class file"

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Sourceforge's RTF Template(rtftemplate-1.0.1-b13.jar) to find and replace a text dynamically in an RTF document. But i am getting an error like"java.lang.UnsupportedClassVersionError: Bad version number in .class file" while running my code. I am using JDK 1.5.
Its running fine in JDK1.6 and 7. But i want this functionality in 1.5 as my app is running in 1.5.(I tried other versions too.. But no help).. Am i missing smething?
Please help.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you aren't missing anything. The compiled code in that JAR file requires Java 6, as you have already guessed.

However you get the source code in the download too, don't you? Then why not just compile that source with your Java 5 compiler?
 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. But the jar file has lots of Java files..Should i compile everything and rebuild the Jar? If yes, any easy way is there?
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Compile all of them and rebuild the jar? Yes, that's what I would try first. (It's possible you may have problems with code which requires Java 6 to compile, so if you encounter that you'll have to do some rewriting.)

I don't understand your question about whether there's an easy way. I'm sure you know how to compile Java code by now; if you don't, then you're just going to run into one problem after another. This is open-source code you're working with here, so you're expected to be able to do simple things like that.
 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is to load the Java source code into some IDE as a Java project and i have to write my own Ant script to compile and build the jar. Am i correct? If yes, its its a little time consuming process and my question is whether the build script to package jar itself is available somewhere?
 
Ranch Hand
Posts: 157
1
Android MySQL Database Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Karthink you will find pom.xml there, by using maven you can build your project.
 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks clapham and Ojha.. you saved my time..
reply
    Bookmark Topic Watch Topic
  • New Topic