This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread 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 Java 8 in Action this week in the Java 8 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaC classpath och JSObject
 
Similar Threads
Problems with aJAR file built using one-jar
include Netscape package in CLASSPATH
evaluating string expressions in Java
using javac and java (chapter 10 k&b)
extending class: cannot find symbol ?