English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories
0

i'm java beginner .trying to write my first java program with drjava IDE

public class Assignment01
{
public static void main(String[] args)
{
System.out.println("My name is Trevor");
System.out.println("I am 17 years old");
System.out.println("My favorite sports are Skiing and Ping-Pong.");
}
}


but when i compile got the unexpected error

File: (no associated file) [line: (no source location)]
Error: java.lang.NoClassDefFoundError: com/sun/tools/javac/util/Context

what to do?what it means?

2007-07-04 11:33:21 · 2 answers · asked by agostino faria f 2 in Computers & Internet Programming & Design

2 answers

This can happen if you have installed the GNU Java compiler (GJC), and end up using that instead of the Sun JDK.

I assume you're using Eclipse? If so, check to see which JDK is being used for compiling, and switch if necessary.

2007-07-04 13:05:03 · answer #1 · answered by McFate 7 · 0 0

hi
set the path and class path to ur current working directory. then it will run. if u use windows OS use this syntax to set path


set path ; and enter
set classpath=%classpath%;;and enter.
if ur using other OS find out where to set path and classpath

2007-07-05 05:54:29 · answer #2 · answered by arun kumar 2 · 0 0

fedest.com, questions and answers