Re: cant's compile with javac



ok now I've set my CLASSPATH, but it didn't help much... this comes
directly from my console:

here it works:

>-----begin screen shot-----<

D:\Program Files\Java\jdk1.5.0_05\bin>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
-cp <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
-endorseddirs <dirs> Override location of endorsed standards
path
-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
-version Version information
-help Print a synopsis of standard options
-X Print a synopsis of nonstandard options
-J<flag> Pass <flag> directly to the runtime system

>-----end screen shot-----<



now, when i move away from the directory that contains javac it doesn't
work:
>-----begin screen shot-----<
D:\Program Files\Java\jdk1.5.0_05\bin>cd ..

D:\Program Files\Java\jdk1.5.0_05>javac
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main

D:\Program Files\Java\jdk1.5.0_05>cd d:\java\server

D:\java\server>dir
Volume in drive D is data
Volume Serial Number is 789B-E0A5

Directory of D:\java\server

23/11/2005 15:38 <DIR> .
23/11/2005 15:38 <DIR> ..
10/12/2004 11:35 142 NetPrinter.java
10/12/2004 11:35 1,016 Server.java
2 File(s) 1,158 bytes
2 Dir(s) 909,910,016 bytes free

D:\java\server>javac Server.java
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main

D:\java\server>javac -classpath . Server.java
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main

D:\java\server>echo %CLASSPATH%
"d:\Program Files\Java\jdk1.5.0_05\bin";.
>-----end screen shot-----<

was also that way when CLASSPATH was just . (period).

thanks,
Ido,

.



Relevant Pages

  • NEWBIE: Exception: java.lang.NoClassDefFoundError: DisplayApp/java/
    ... I wrote my sample program using Eclipse. ... have all the jar files as displayed on the eclipse editor. ... Exception in thread "main" java.lang.NoClassDefFoundError: ... I used both upper and lower cases for the %CLASSPATH% to see whether ...
    (comp.lang.java.help)
  • Re: JBoss startup exceptions
    ... you need to set the JAVA_HOME variable in your classpath to the directory where ... your jdk is. ... jus recollecting i think thats what ... i did to get rid of that exception. ...
    (comp.lang.java.programmer)
  • Re: Problem with run WSDL2Ws tool(Axis C++1.6b)
    ... I have new problem with WSDL2Ws tool. ... sclient -oD:/Axis ... Exception in thread "main" java.lang.NoClassDefFoundError: ... The two options don't go together, and you have to give the "-classpath" option an argument indicating the classpath, which you didn't do. ...
    (comp.lang.java.programmer)
  • Re: ZX81 Tapes.
    ... probably because I'm doing something stupid:) ... Exception in thread "main" java.lang.NoClassDefFoundError: ... tapeutil/zx81/Convert SampleToP ... You need to set your classpath to point to the tapeutils.jar file - ...
    (comp.sys.sinclair)