• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

IText PDF Encryptor

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My application runs on java 1.5. I use iText 5.0.2 libraries to create and encrypt data into a pdf file. But, while encrypting using the method PdfEncryptor.encrypt(),
I get the error :

java.lang.UnsupportedClassVersionError: Bad version number in .class file



It is working fine on java 1.6. The iText site says, It supports java 1.5. My application is supposed to run on a server which uses java 1.5. So, will have to stick on to 1.5.
can anyone help me with a solution?
Thanks in advance..!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post the entire error message (which tells us which class has a bad version number).
 
Nitin Menon
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved..!javascript:emoticon('');

Anyway, I am stating the problem and the description.
My problem is actually with Java Versioning. I had explained about it in the current post and my earlier post:

https://coderanch.com/t/500586/java/java/Java-versioning

I was getting the above error because, even though my system was using java 1.5, since i used java 1.6 to compile my application earlier (i guess..!), a file at the location namely,
src -> Libraries -> Web App Libraries/bcprov-jdk16-145.jar
supports JDK 1.6 and not java 1.5.
You can learn about the file from the site

http://www.bouncycastle.org/latest_releases.html



I replaced it with another file, bcprov-jdk15-143.jar which is for Java 1.5 and the problem is solved..!
Thank you very much Ulf, for the time and concern.
 
reply
    Bookmark Topic Watch Topic
  • New Topic