java

why i am getting the following error while running javac command from console

C:>javac
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Comments

  • Send the source code that you are compiling. May be mistake in defining a class.
  • Send the source code that you are compiling. May be mistake in defining a class.
  • javac is a command that compiles a code to be compiled. for example: javac code.java. then there is java. for example java code. that for contrast, runs the code ;D
  • But if it's having problems compiling, then wouldn't it not work at runtime?
  • no - he's saying that typing 'javac' alone into the prompt isn't productive. add the name of the file

    javac mycode.java


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories