After a few days of searching for an ebook I thought might be good to start me on the path to programming, I started to read "Beginning JAVA 2nd Ed." by Danny Poo. In the book he tries to walk you through setting up the Environment Variables to use the cmd to execute the JAVA code ( I think-could be wrong). I was looking over a different book and they did pretty much the same thing, and I figured out how to do it. But with Poo, I just can't get it to do what he explains in the book.
Currently JAVA is in: C:\Program Files\Java\jdk1.6.0_33
(Sorry for o pics haven't figured out how to post those yest.)
Before we can compile the Java program, we need to ensure that Windows know where to locate the Java compiler. For example, entering “javac” at the Command Prompt will result in an error message:
It shows "javac is not recognized blah blah blah. (I got that part)
To correct this, Start->Control Panel->System->Advanced->Environment Variables. At the “User Variables for …” section, click “New”. Enter the following variable name and value, click “OK”.
VARIABLE NAME - JAVA_HOME
VARIABLE VALUE - C:\Program Files\Java\jdk1.6.0_33 (in the book it's actually ...jdk1.7.0_01
At the “User Variables for …” section, click “New” Enter the following variable name and value, click “OK”
VARIABLE NAME - PATH
VARIABLE VALUE - %JAVA_HOME%\BIN
Click “OK” until you exit the Control Panel screen. Open a new Command Prompt. Start->All Programs->Accessories->Command Prompt Type in “javac” in the Command Prompt and you should see the following:
Before I would get the long dos screen with Usage: javac <options> <source files>
that whole screen. Now I don't. And I can not find the book or where exactly the other tutorial is that I got that dos screen the first time. I was using netbeans before 'cause the other book instructed me to use that. Poo is just using the dos window. At least for now.
After going back through a couple of tutorial ebooks, downloading JAVA 7 and reworking the "Beginning JAVA by POO, I was able to get things right. Don't know if it was because I went back over the previous ebooks or because it just clicked!
One important note: the language is called "Java", it's not an acronym for anything, it's an actual name. I'm just adding that because it (1) hurts my eyes and (2) would raise an unnecessary uh-oh-flag with a competent potential employer if you write "JAVA" in your cv.