File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Compile Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compile Problem" Watch "Compile Problem" New topic
Author

Compile Problem

Lawrence Keeney
Greenhorn

Joined: May 31, 2004
Posts: 17
In my .java file I have the statement:


I have generated a pde.jar file that contains the following files
\netscape\javascript\JSException.class
and
\netscape\javascript\JSObject.class

The pde.jar file is in the same directory as the .java file I am trying to compile, yet the compiler can not find the two .class files. What am I missing?


Lawrence
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
Add the jar file to the classpath explicitly. Make sure you keep the .jar extension when doing so.


Anthony W.<br />MCP, SCJP 1.4, SCJD, SCWCD 1.3, SCWCD 1.4, SCBCD
Lawrence Keeney
Greenhorn

Joined: May 31, 2004
Posts: 17
Anthony,

I did a set classpath=C:\0xfer\pcquest - applet to script
This (c:\0xfer\pcquest - applet to script) is the location of the .jar file yet it still does not work.

[ June 22, 2004: Message edited by: Lawrence Keeney ]
[ June 22, 2004: Message edited by: Lawrence Keeney ]
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
You need to explicitly state that the .jar file is on the classpath. It does not work to put the directory that the .jar is in on the classpath. Make one addition to your classpath for each .jar file you are using. Make sure to include the .jar extension when adding the file to the classpath.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Here is the handy-dandy JavaRanch guide to CLASSPATH. Have a look-see.


[Jess in Action][AskingGoodQuestions]
Lawrence Keeney
Greenhorn

Joined: May 31, 2004
Posts: 17
Anthony & Ernest,

Thanks for the help.

I finally got it to work. After following all the instructions it still did not work. I found the file I thought was called pde.jar was actually called pde.zip. Unfortunately this does not show in the XP directory. I found it by going back to DOS.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compile Problem