M
Miss Michelle. Heigardt
Hallo newsgroup, I am getting the error
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
JAVA_HOME does point to my JDK. My Tomcat works with no problem. My
Apache2 works with no problem. But I cannot compile. I am logged onto a
free Debian 3.1 system as root. You can see at the bottom I am using
Java 1.4 and both java and javac can be run from the command line
without problem. Searching in Google there are lots of talk on
tools.jar but I dont think this is for me as my Tomcat & Apache2 work.
What shall I look for now? What shall I do?
Thank you
Michelle
deb31Test:~/t9/v876/samples/jpetstore#echo $JAVA_HOME
/usr/local/lib/jdk
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# ls /usr/local/lib -l
total 16
drwxrwxr-x 9 root src 4096 Aug 27 01:51 j2sdk1.4.2_08
lrwxrwxrwx 1 root staff 28 Aug 27 01:55 jdk ->
/usr/local/lib/j2sdk1.4.2_08
drwxrwsr-x 3 root staff 4096 Jan 16 08:56 python2.3
drwxrwsr-x 3 root staff 4096 Jan 6 11:27 site_ruby
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# find / -name tools.jar -print
/usr/lib/j2se/1.4/lib/tools.jar
/usr/local/lib/j2sdk1.4.2_08/lib/tools.jar
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# ls -la
/usr/local/lib/j2sdk1.4.2_08/lib/tools.jar
-rw-r--r-- 1 root root 5092686 Jan 11 15:19
/usr/local/lib/j2sdk1.4.2_08/lib/tools.jar
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# ant build
Buildfile: build.xml
build:
[javac] Compiling 73 source files to
/t9/v876/samples/jpetstore/.classes
BUILD FAILED
/t9/v876/samples/jpetstore/build.xml:76: Unable to find a javac
compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
Total time: 4 seconds
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is
doing
-deprecation Output source locations where deprecated
APIs are used
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class
files
-encoding <encoding> Specify character encoding used by source
files
-source <release> Provide source compatibility with specified
release
-target <release> Generate class files for specific VM
version
-help Print a synopsis of standard options
The line in my build.xml says
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" source="1.4" target="1.4" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="master-classpath"/>
</javac>
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
JAVA_HOME does point to my JDK. My Tomcat works with no problem. My
Apache2 works with no problem. But I cannot compile. I am logged onto a
free Debian 3.1 system as root. You can see at the bottom I am using
Java 1.4 and both java and javac can be run from the command line
without problem. Searching in Google there are lots of talk on
tools.jar but I dont think this is for me as my Tomcat & Apache2 work.
What shall I look for now? What shall I do?
Thank you
Michelle
deb31Test:~/t9/v876/samples/jpetstore#echo $JAVA_HOME
/usr/local/lib/jdk
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# ls /usr/local/lib -l
total 16
drwxrwxr-x 9 root src 4096 Aug 27 01:51 j2sdk1.4.2_08
lrwxrwxrwx 1 root staff 28 Aug 27 01:55 jdk ->
/usr/local/lib/j2sdk1.4.2_08
drwxrwsr-x 3 root staff 4096 Jan 16 08:56 python2.3
drwxrwsr-x 3 root staff 4096 Jan 6 11:27 site_ruby
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# find / -name tools.jar -print
/usr/lib/j2se/1.4/lib/tools.jar
/usr/local/lib/j2sdk1.4.2_08/lib/tools.jar
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# ls -la
/usr/local/lib/j2sdk1.4.2_08/lib/tools.jar
-rw-r--r-- 1 root root 5092686 Jan 11 15:19
/usr/local/lib/j2sdk1.4.2_08/lib/tools.jar
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# ant build
Buildfile: build.xml
build:
[javac] Compiling 73 source files to
/t9/v876/samples/jpetstore/.classes
BUILD FAILED
/t9/v876/samples/jpetstore/build.xml:76: Unable to find a javac
compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
Total time: 4 seconds
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore#
deb31Test:~/t9/v876/samples/jpetstore# javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is
doing
-deprecation Output source locations where deprecated
APIs are used
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class
files
-encoding <encoding> Specify character encoding used by source
files
-source <release> Provide source compatibility with specified
release
-target <release> Generate class files for specific VM
version
-help Print a synopsis of standard options
The line in my build.xml says
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" source="1.4" target="1.4" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="master-classpath"/>
</javac>