File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes problem in Compiling servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem in Compiling servlets" Watch "problem in Compiling servlets" New topic
Author

problem in Compiling servlets

renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
Hi,

When i tried compiling login.java,i got the below error.

But it is getting compiled fine if i set weblogic.jar in the classpath.

Can someone please tell me why it is not getting compiled with the servlets-api.jar.
[ October 07, 2008: Message edited by: ren_richard ]

Cheers,
Richard
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

"ypren", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2718
    
    6

Hi ypren welcome to Javaranch ,

Firstly use code tags for your code. Unformatted code is hard to read and results in less response for your post. You can add code tags by editing your post, to edit the post click the .

The reason you are experiencing the problem is the version incompatibility.
Which versions of Weblogic and Java are you using?


SCJP, SCWCD.
|Asking Good Questions|
renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
Thanks Amit for your valuable comments.

Weblogic version : 8.1
Java version : Tried using both JDK1.4 and 1.6
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14430
    
  23

"ren_richard" - first, please check your private messages again.

The following line in the error message that you get:

class file has wrong version 49.0, should be 48.0

Suggests that you are using classes that were compiled with JDK 5.0, and you are trying to use them with JDK 1.4. That will not work.

I see that you are using Tomcat 6.0. That version of Tomcat requires JDK 5.0 or newer. The JAR files in that version of Tomcat are compiled with JDK 5.0, so you will get into trouble if you try to use those JAR files on Java 1.4.

Use the JAR files that you get with Weblogic 8.1 to compile and run your application instead of those you get with Tomcat 6.0.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in Compiling servlets