This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes IDEs, Version Control and other tools and the fly likes Unable to create a servlet in eclipse IDE? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Unable to create a servlet in eclipse IDE?" Watch "Unable to create a servlet in eclipse IDE?" New topic
Author

Unable to create a servlet in eclipse IDE?

naveen maddala
Greenhorn

Joined: Feb 03, 2008
Posts: 23
Hi,
I am unable to create a servlet in eclipse IDE.But it showing the following 2 errors.

1.The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this.

2.The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files serv.java(my servletname).

i have installed JDK 1.5 and i am using eclipse 3.1 and tomcat 5.5.27 as web server.

anybody help me how to resolve this.

Regards,
Naveen.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Sounds like you don't have a JDK in your project build path, or the one you have is invalid. Right click on your project, go to Properties>Java Build Path, click on the libraries tab and see what's in there. You will need a JRE SYstem Library listed. If you have one edit it and see that where it is installed is valid.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3826

This has nothing to do with servlet but IDE I guess.

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this.

The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files serv.java(my servletname).


Check whether your eclipse is configured with the java installation.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
Naveen.,

I presume that you have java [JDK, that is] installed on your machine. If that is correct, then proceed as follows:

Open Eclipse, and in the "Window" menu;

Preferences > Java > Installed JREs

On the right hand side, click on the "Add" button, select "Standard VM", and in the resulting pane, browse and select the JDK installation directory. [I understand that the heading says "Installed JREs", but selecting a JDK here is always the better idea].

Once all this is done, try out a simple hello world program after creating a java project in eclipse, and see if that is working correctly.
This will ensure that you have a good working setup. Now, for developing servlets, you'll need the servlet-api.jar in your classpath as well. Hope that helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to create a servlet in eclipse IDE?