cant's compile with javac



Hi, whenever I try to compile something with javac from the command
prompt (windows XP) i get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main

even if I just write "javac" without a file to compile i get the same
error.
The only time when i works correctly is when I'm in the bin directory
that contains javac, the i can compile everything. If i change to a
different directory it doesn't work and i get the afordmentioned error.
one more thing - when i compile from eclipse it works, i only get it
when manually compiling for the command prompt.
I'm using version 1.5 update 5 (the last one) but it happened with
earlier versions as well (1.5 update 1, update 2, etc..)

Thanks in advance for your help.

.



Relevant Pages

  • Re: cannot run javac command
    ... No problems with using Netbeans--but can't compile the hello world prog ... using command line. ... That's done but when I go to javac helloworldapp.java as system does not ... Microsoft Windows XP Copyright ...
    (comp.lang.java.help)
  • Re: newbie servlet help
    ... > I'm geting this error when I try to compile a servlet (command line ... a separate jar file (servlet.jar) with the servlet container. ... that location as part of the classpath for javac and java. ... Try adding '-source 1.4' to the javac command. ...
    (comp.lang.java.programmer)
  • Re: cants compile with javac
    ... > even if I just write "javac" without a file to compile i get the same ... > when manually compiling for the command prompt. ...
    (comp.lang.java.help)
  • Re: Dealing with packages UNIX
    ... Everything has the same package name in teh same directory. ... ALso when my web app runs it is using an older version of the class file taht wont compile even afer I did a rm *.class and replaced them with the javac *.java. ... javac needs a defined sourcepath to work. ...
    (comp.lang.java.programmer)
  • Re: Learning JAVA need help
    ... I also tried to run the compile from the command line using the command ... Exception in thread "main" java.lang.NoClassDefFoundError: ... The exception is thrown by the javac command and not by your ...
    (comp.lang.java.help)