This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Compilation Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compilation Error" Watch "Compilation Error" New topic
Author

Compilation Error

Shiraz Bhagwagar
Greenhorn

Joined: Mar 28, 2001
Posts: 27
While compiling java programs, (using JDK 1.3.1), I get an error
"Exception in thread main java.lang.NoClassDefFoundError :server"
What could this be. I have set the path to c:\jdk1.3.1\bin
What else could this be.
I cannot compile any programs. Am using Win 2000 Prof. .
Got the same error on another machine and got rid of the error by setting the path variable.
navin kumar
Greenhorn

Joined: May 22, 2001
Posts: 9
hello,
After compilation of Your program, at command prompt
> java <classname>;
You must give the classname which is having the main() method.
for ex: test.java

class test
{
public static void main(String args[])
{
System.out.println("THIS IS FOR TESTING");
}
}
>javac test.java
>java test => this command gives
THIS IS FOR TESTING
If U had still doubts regarding this concept, U can contact me.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Are you trying to compile RMI programs? Got a clue what "server" refers to?

"JavaRanch, where the deer and the Certified play" - David O'Meara
Shiraz Bhagwagar
Greenhorn

Joined: Mar 28, 2001
Posts: 27
Yes Navin I did get that.
Cindy, I am trying to code a chat program. The server is the chat server and the client is that chat client. That is what the server is. In fact I am surprised that none of the programs (even the simple ones like the on Navin has written) compile. That is what surprises me.
Shiraz Bhagwagar
Greenhorn

Joined: Mar 28, 2001
Posts: 27
Cindy, Also I forgot to add. These are not RMI programs, these are just simple java programs using the material prescribed in tHe Certification syllabus.
Shiraz Bhagwagar
Greenhorn

Joined: Mar 28, 2001
Posts: 27
No one yet ..............
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Well, I don't know anything about Win2000.
WAIT! just thought of something - I heard about some problems . . .
Apparently you need to install the service pack 1 (sp1) to fix a few problems in win2000.
This has a link to the download. http://support.microsoft.com/support/kb/articles/Q273/7/35.ASP
Shiraz Bhagwagar
Greenhorn

Joined: Mar 28, 2001
Posts: 27
Yes Cindy. I have downloaded the patches. I have downloaded the java executable and re-installed it. Nothing works. I get the same error.
Exception in thread "main" java.lang.NoClassDefFoundError:server.
This very same program runs on my other machine with Win ME. Have checked the path file and there seems to be no problem.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Compilation Error
 
Similar Threads
Java problem: Could not find or load class
Installation problem
syntax error on token "+", ++expected
Cannot Run the Tomcat
Error at command-line: Unable to run Java program after successful compilation