Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IText PDF Encryptor

 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • 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..!
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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: 87
  • Mark post as helpful
  • send pies
  • 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:

http://www.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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic