This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes IText PDF Encryptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "IText PDF Encryptor" Watch "IText PDF Encryptor" New topic
Author

IText PDF Encryptor

Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 83
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
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
Post the entire error message (which tells us which class has a bad version number).


Ping & DNS - my free Android networking tools app
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 83
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IText PDF Encryptor