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 Beginning Java and the fly likes JavaC classpath och JSObject 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 » Java » Beginning Java
Bookmark "JavaC classpath och JSObject" Watch "JavaC classpath och JSObject" New topic
Author

JavaC classpath och JSObject

John Larssen
Greenhorn

Joined: Aug 27, 2003
Posts: 5
Im a newbe and need som help compiling .java to .class.
in the .java a class JSObject is used, and I understand this is a part of Netscape.javascript.* but as I don't want to install Netscape I found the Mayscript.jar containing the JSObject.class. Now I wonder how to compile with this external class. The JavaC compiler wont accept it, I have tried with the classpath parameter. Grateful for any help.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, John!
If the JAR file contains the required class(es), then you should be able to compile your source file(s) if the CLASSPATH is configured correctly.
What is your CLASSPATH value? What is the exact command you're using to compile? What is the error message?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
John Larssen
Greenhorn

Joined: Aug 27, 2003
Posts: 5
Managed to get the classfile right. But now I got another error when compiling: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
And I have absolutely no idea what this means
Please help me.
John Larssen
Greenhorn

Joined: Aug 27, 2003
Posts: 5
CLASSPATH that is, ofcourse. Hmm maybe I didnt get it right?
John Larssen
Greenhorn

Joined: Aug 27, 2003
Posts: 5
Nevermind, I solved the problem.
Wrong PATH settings.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JavaC classpath och JSObject