Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java versioning problem

 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recompile with 1.5.
 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Recompile with 1.5.


I tried re-compiling. But, It's all the same..!
 
Rob Spoor
Sheriff
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the -target 1.5 compiler flag.
 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I'll try that and let you know..!
 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think my eclipse is got corrupted. I cannot override the default project settings for java compiler to 1.5 version.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic