classpath problem with compiler...
I'm an experienced programmer but new to Java.
I thought I had the whole classpath thing figured out but I'm having trouble....
I'm working on a project that uses Axis and I was trying to compile somthing to simply return the Message context.
The problem I'm having is that no matter how I set up my class path, it can't find axis.jar (I think...).
Here's the code:
package PlexPackage;
import org.apache.axis;
publicclass PlexServ{
public String ReturnContext()
{
MessageContext mc = MessageContext.getCurrentContext();
return"";
}
}
Here's the bat file I'm using to compile it.
I put in the DIR to confirm that my class path was pointing to the jar.
(I've confirmed that the MessageContext class IS in that jar under org.apache.axis).
CompilePlex.bat file:
set CP="C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar"
dir %CP%
"C:\Program Files\Java\jdk1.5.0_06\bin\javac.exe" -cp %CP% PlexServ.java
and here's the results I get from running the BAT file:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\classes\PlexPackage>CompilePlex.bat
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\classes\PlexPackage>set CP="C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar"
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\classes\PlexPackage>dir"C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar"
Volume in drive C has no label.
Volume Serial Number is 68F7-0E7D
Directory of C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib
04/22/2006 06:56 PM 1,599,570 axis.jar
1 File(s)1,599,570 bytes
0 Dir(s) 12,621,848,576 bytes free
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\classes\PlexPackage>"C:\Program Files\Java\jdk1.5.0_06\bin\javac.exe" -cp"C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar" PlexServ.java
PlexServ.java:2:package org.apache does not exist
import org.apache.axis;
^
PlexServ.java:6: cannot find symbol
symbol :class MessageContext
location:class PlexPackage.PlexServ
MessageContext mc = MessageContext.getCurrentContext();
^
PlexServ.java:6: cannot find symbol
symbol : variable MessageContext
location:class PlexPackage.PlexServ
MessageContext mc = MessageContext.getCurrentContext();
^
3 errors
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\classes\PlexPackage>
So questions to the group:
Do you see anything obvious I'm doing wrong?
I've tried MANY variations on setting the classpath (absolute, relative, etc) and all with the same results.
Do I only have to reference the jar I'm using in the classpath (axis.jar),
or do I have to list every jar that's referenced downstream?
(i.e. every jar that axis.jar references, and all the jars they reference, etc.)
Many thanks for any assistance!
S

