Need Help Compiling!

When I compile java using me text editor everything is as smooth as sand but when I go to my ms-dos prompt and type

javac Root.java

it turns out to be a bad comand. I have windows 98SE btw and don't understand what the problem is?

Now my real problem is when I get my java file to compile using my text editor and try to open the class file with ms-dos by doing--

java Root

it turns out saying NoClassDefFound, I don't know what this means.

If anyone could help me on this I'd vary much appreciate it but other then that thanks for your time.

[589 byte] By [JavaBrewa] at [2007-10-2 5:59:37]
# 1
this is the response I get from the comand line when typing in java RootException in thread "main" java.lang.NoClassDefFoundError: Root
JavaBrewa at 2007-7-16 13:00:01 > top of Java-index,Developer Tools,Java Compiler...
# 2

> When I compile java using me text editor everything

> is as smooth as sand but when I go to my ms-dos

> prompt and type

>

> javac Root.java

>

> it turns out to be a bad comand. I have windows 98SE

> btw and don't understand what the problem is?

You need to add the directory that contains javac.exe to the PATH variable maintained by your computer's operating system. SEE #5 of the installation instructions here:

http://java.sun.com/j2se/1.5.0/install-windows.html

> Now my real problem is when I get my java file to

> compile using my text editor and try to open the

> class file with ms-dos by doing--

>

> java Root

>

> it turns out saying NoClassDefFound, I don't know

> what this means.

It means that you don't know how to work with Java's CLASSPATH variable, which is extremely important for you to understand if you plan on writing and running Java code. Read the following documents at this address:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#general

Setting the Classpath

How Classes are Found

javac [tool]

java [tool]

>

> If anyone could help me on this I'd vary much

> appreciate it but other then that thanks for your

> time.

To run your program, change to the directory that contains Root.class and do a directory listing. Verify that the file exists with that exact name and capitalization. Fix any problem. From the same location, issue the following command:

java -cp . Root (Mind the period and surrounding spaces.)

ChuckBinga at 2007-7-16 13:00:01 > top of Java-index,Developer Tools,Java Compiler...