aspose file tools*
The moose likes Beginning Java and the fly likes Error in compiling a source code  *.java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error in compiling a source code  *.java" Watch "Error in compiling a source code  *.java" New topic
Author

Error in compiling a source code *.java

Jess
Greenhorn

Joined: Dec 29, 2003
Posts: 2
When I compile a source code *.java with SDK 1.4 there is an Error Message:
"Exception in thread "main" java.lang.NoClassDefFoundError...etc.
What's the problem?
Describe me the procedure exactly!
Help me! I'm beginner!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8707
    
    6

Originally posted by Jess:
When I compile a source code *.java with SDK 1.4 there is an Error Message:
"Exception in thread "main" java.lang.NoClassDefFoundError...etc.

NoClassDefFoundError is caused by classpath problems, which one can solve by consulting the appropriate section of the
beginners FAQ, however, we don't usually see that error when compiling. Are you attempting to use the Java Virtual Machine (i.e. "java") to compile instead of the compiler (i.e. "javac")? If you want "exact" answers you must ask "exact" questions, like including the complete command line you issued and the complete error which occurred.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Jess
Greenhorn

Joined: Dec 29, 2003
Posts: 2
I specify it step by step:
1- C:\j2sdk1.4.1_02\src\java\awt > javac Rectangle.java
2- Error Message: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
Thanks!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8707
    
    6

That's a bigger problem. Check out this thread in the Java Technology Forums:

the best alternative is to uninstall and reinstall java
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Jess,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in compiling a source code *.java
 
Similar Threads
Getting parameters from the htmp page
install4j Exception error
JDBCExceptionReport and Hibernate
Writing XML File - Null Pointer Exception
log4j levels