javac is working but not java

PLEASE HELP.

I've got a project due very soon, and I can't get very far until I can run my apps.

Thank you,

Dustin

__

1.

I CAN compile a single .java file if it does NOT refer to any class outside of itself.

2.

I CAN'T compile a .java file if it refers to another class outside of itself (even if it's with in the same directory.

3.

If I comment out the line that refers to an outside class then I can compile the .java file.

HOWEVER, When I run the 'java Ap00.class' command, I get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: Ap00/class.

This also applies to the above part 1. I can't work the .java command no matter what.

4. Here is my

classpath:

".;C:\j2sdk1.4.1_01\lib;C:\Prog\AudioPlayer;"

Path:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\ULTRAE~1;C:\Program Files\Common Files\Autodesk Shared\;C:\j2sdk1.4.1_01\bin

They look alright to me.

5. Yes, this program used to run just fine. I have not altered it. Everything got screwy when I upgraded to WinXP.

6. Everything works fine inside of a an IDE like Forte.

Ap.00 compiles and runs.

It seems that the answer is right under my nose, but I just can't put it together.

[1338 byte] By [lydaya] at [2007-9-28 3:07:26]
# 1

Open a console window.

Type the following

echo %CLASSPATH%

The output is your class path. (Do not guess what it is. Follow the above to find out exactly.)

Your classes do NOT have packages right?

You can test a class path with the following even if there is no 'main' in the class.

java MyClass

If you run the above and you get a no class found error, then your class path is wrong. If you get a 'no main' (or it runs) then the class path is right.

This part of your classpath "C:\j2sdk1.4.1_01\lib" is non-sensical. I doubt you are putting your classes in there. And java itself uses jars and that will not pick them up. Remove it.

When you run you are in the directory where the class files are correct? Or they are in "C:\Prog\AudioPlayer"

jschella at 2007-7-7 22:40:19 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
You could try compiling a number of files on the same line. Like:javac file1.java file2.java file3.java
cyrus_dlxa at 2007-7-7 22:40:19 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

there is a possibility that u will need to declare a variable in the windows xp directory. windows xp is different from the other versions of windows develop by microsoft. as there is no "real" dos that exists in xp, it is therefore a need to create a temp directory in which your files is to be created and executed.

i hope this really helps. if in any part that i'm wrong...feel free to correct mi. i'm a newbie in java... so i still need to learn a lot from all the java experts here

:)

nicole

skystars_22a at 2007-7-7 22:40:19 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4

Do you know the classpath of your system before upgrading to XP? If yes then just add the classpath to the exsisting classpath of your system.( here i am assuming that the directory and the file paths are the same as before). Else just add the path to your directory ( The one which has the .class files) to your classpath.

That should do the trick.

dhiraj23a at 2007-7-7 22:40:19 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 5
I noticed you tried to run:java Ap00.classIt thinks you have a class called "class" in a package called "Ap00".What you want to do is:java Ap00
WWWizarda at 2007-7-7 22:40:19 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...