This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Having trouble running HelloWorld. I have my programs in a folder called "java" off the c: drive. When I type in "java java\HelloWorld" I get the error message "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld". I was able to complile it.
You work as follows: staying in directory "work" contaning directory java thus you have: ..\work\java\HelloWorld.java and HelloWorld.java containing: "package java;" compile: javac java\HelloWorld.java run: java java.HelloWorld YOu see the point and not the backslash? But this should be asked at the beginners thread not here?!
Actually, it's in the first lesson of the Cattle Drive. I would have left it open here.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Jan 19, 2001
Oops! Opened it up again (no replies in the Java in General forum, where it will be deleted now).
Marilyn de Queiroz
Joined: Jul 22, 2000
David, I wonder why you are typing "java java\HelloWorld". After you compile HelloWorld.java using javac HelloWorld.java, can you see HelloWorld.class in the C:\java subdirectory? Did you add C:\java to your classpath? If so, you should be able to type "java HelloWorld" and watch the program run.