Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to get started with head first java

 
Carole Hagen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm new to programming and my programming class is using Dr. Java. I really need something more and purchased the Head First java book 2nd Edition. I believed that I have followed the instructions on page XXVIII about how to download SDK and the API files. I also set my path. I know how to go to the command line, how can I get started to see if my compiler will run Java commands?

Thank you!
Carole
 
Paul Yule
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
type javac in the cmd prompt. This is used for compiling java files. If it is set up correctly you should get a message about how to use javac.
 
Carole Hagen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I type javac into my command prompt, but I am receiving a message that says:

'javac' is not recognized as an internal or external command, operable or batch file.

I think that means I need to set my path. I used some online instructions to do that, but I think I may have something wrong here. Here is what I have under Environmental Variables:

C:\Program Files\Java\jdk 1.6.0_11\bin C:\Program Files\Java\jdk 1.6.0_11\bin
PATH C:\Sun\SDK\bin
SYBASE c:\sql11
TEMP C:\Documents and Settings\Hagen.Carole\Local Settings\Temp
TMP C:\Documents and Settings\Hagen.Carole\Local Settings\Temp

Here is what I have under System variables
C:\Program Files\Java\jdk 1.6.0_11\bin C:\Program Files\Java\jdk 1.6.0_11\bin
CLASSPATH C:\Program Files\Java\j2re 1.4.2_06\lib\ext\QTJava.zip
ComSpec ..............

there is more and I've attached a picture of my Environmental Variables window. If anyone knows what I'm doing wrong, please let me know. When I try HelloWorld from my command line, I can get it if I don't include 'javac' - so I'm convinced it has to do with my path. THANKS!!



 
fred rosenberger
lowercase baba
Bartender
Posts: 12125
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after you set the path, you have to open a new command window. If you have one already open, it won't pick up the changes.

type only the word "path" on the command line, and that will show you what THAT session thinks the path is.

something else to try is to navigate to the directory where you think java is, and see if you can run the javac command from there...

i.e. here's my path:

I:\>path
PATH=C:\Perl\site\bin;C:\Perl\bin;C:\PROGRA~1\REFLEC~1;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\WINDOWS\Downloaded Program Files;C:\Program Files\Altiris\Software Virtualization Agent\;C:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Program Files\iPath\Bin;C:\MySQL\bin;C:\Program Files\Java\jdk1.6.0_11\bin;C:\Program Files\QuickTime\QTSystem\

so, I went to my jdk directory:

c:
cd "Program Files\Java\jdk1.6.0_11\bin"

and then I ran javac. if you can run it from there, then you know it's installed, and you have a path problem. if it DOESN'T run from there, it's either a) not installed, or b) it's installed somewhere else.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15284
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun's Hello World! tutorial explains step by step how to write, compile and run your first Java program.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48968
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to be getting lots of help, Carole, so I shall just say . . .




Welcome to JavaRanch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic