Click to See Complete Forum and Search --> : Classpath issue?


thedosmann
07-06-2005, 08:35 PM
I have jdk installed..
Path Env var in windows set..

I have a .java file I'm trying to compile
path d:\inetpub\wwwroot\bdd\search\EnginePrefs.java

It calls a .class that is same dir -Monitor.class

I call javac with the following:

javac -classpath d:\inetpub\wwwroot\bdd\search d:\inetpub\wwwroot\bdd\search\EnginePrefs.java

and get the following:
[CODE]
d:\inetpub\wwwroot\bdd\search\EnginePrefs.java:42: cannot find symbol
symbol : class Monitor
location: class bdd.search.EnginePrefs
Monitor monitor = null; // query and url monitor
^
d:\inetpub\wwwroot\bdd\search\EnginePrefs.java:257: cannot find symbol
symbol : class Monitor
location: class bdd.search.EnginePrefs
public Monitor getMonitor() {
^
Note: d:\inetpub\wwwroot\bdd\search\EnginePrefs.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: d:\inetpub\wwwroot\bdd\search\EnginePrefs.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
[\CODE]

Why can't it find Monitor class?

I'm sure this is a simple fix but I can't I've tried several combo's with no success.
I'll deal with the other issues later..just trying to figure out the path deal first.

Thanks

buntine
07-06-2005, 08:58 PM
Have you got a package declaration at the top of the first file?

thedosmann
07-06-2005, 11:47 PM
Sorry..Yes i do

package bdd.search;

Oak
07-07-2005, 12:21 AM
It sounds like it is a problem with the java set up.

Review this information and come back if it still doesnt work:

Java Setup (http://www.webdeveloper.com/forum/showthread.php?t=44232)

Good luck :)

thedosmann
07-07-2005, 05:48 PM
I was compiling other class files with no issue but wasn't using class ref that was in package..just java.lib.class file ref.
I found that by not using -cp I could get it to work....

javac d:\inetpub\wwwroot\bdd\search\EnginePrefs.java
or
javac \inetpub\wwwroot\bdd\search\EnginePrefs.java

Both of the above work (watch what dir you make the call from)

javac -cp d:\inetpub\wwwroot\bdd\search d:\inetpub\wwwroot\bdd\search\EnginePrefs.java
javac -cp \inetpub\wwwroot\bdd\search \inetpub\wwwroot\bdd\search\EnginePrefs.java

does not work

Go figure!?
This is probably the path structure I'm using? Anways, I got it to compile.