File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "IText PDF Encryptor" Watch "IText PDF Encryptor" New topic

IText PDF Encryptor

Nitin Menon
Ranch Hand

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

Joined: Mar 22, 2005
Posts: 42965
Post the entire error message (which tells us which class has a bad version number).
Nitin Menon
Ranch Hand

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

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

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:
subject: IText PDF Encryptor
It's not a secret anymore!