aspose file tools*
The moose likes Java in General and the fly likes Java versioning problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java versioning problem" Watch "Java versioning problem" New topic
Author

Java versioning problem

Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 79
Hi,
Stating my problem.
I am working on a java multi-tier application. It uses Spring framework on the controller side and Hibernate to handle the jdbc. The web server is Apache Tomcat-5.5.27. I use Adobe Flex 3 on the view side. There are java classes, Servlets and JSP's playing intermediate roles throughout the application. The Application runs on a server machine which uses Java 1.5. My system got acidentally updated to java 1.6.
I am supposed to get the assigned module working and then export the project into a war file and deploy on the server.

When i do that, I get a
Bad version number in .class file
error.

I googled and found out it was a versioning error. So, I uninstalled the java 1.6 and installed the 1.5 on my system. I altered the java_home in the environment variables.
Now, when I run the project, I get the same error on my client machine too. Is there anything to be changed in order to straighten out the situation?
I get the error in a method
PdfEncryptor.encrypt(new PdfReader(notTheEncriptedFile), new FileOutputStream(EncriptedFile), userPassword.getBytes(), ownerPassword.getBytes(), PdfWriter.ALLOW_PRINTING , true);

The class PdfEncryptor.encrypt() comes with the iText 5.0.2 libraries.
Can anyone please help me find a possible sloution to this problem? My client machine runs on windows 7 and the server on Redhat linux.

Thanks in advance. javascript:emoticon('');
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Recompile with 1.5.
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 79
David Newton wrote:Recompile with 1.5.


I tried re-compiling. But, It's all the same..!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

Use the -target 1.5 compiler flag.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 79
Thank you. I'll try that and let you know..!
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 79
I use eclipse 3.3 Europa. I guess compiling happens when i clean and deploy the application. I had tried it. Also, I tried by deleting the old class files. But, Still, I have that problem.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Then you need to figure out why your code is getting compiled with 1.6--*something* is causing your code to get compiled incorrectly (for your needs).
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 79
I think my eclipse is got corrupted. I cannot override the default project settings for java compiler to 1.5 version.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java versioning problem