• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to point path environment to /bin directory?  RSS feed

 
Juan Moises Moreno
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I currently working on the book Head First Java but I am stuck in the preface. I am a real noobie and I don't know what I am supposed to do. "You need to add an entry to your PATH environment variable that points to the bin/ directory called (sdk), look inside that directory and you will find the (bin) directory where the Java binaries (the tools) live. The bin directory is the one you need a PATH to, so that when you type: % javac at the command line, your terminal will know how to find the javac compiler.

I tried 2 methods that were posted on an older thread but I don't know what I am doing wrong. Please give me a hand.
java-fail.PNG
[Thumbnail for java-fail.PNG]
no!!!
java-fail2.PNG
[Thumbnail for java-fail2.PNG]
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Have you tried our FAQ? It explains how to set the PATH variable. What you showed in the screenshots (though we often find screenshots difficult to use) would appear to show a correct PATH, but it is often better to put that PATH element at the beginning.
Try the following instruction:-You are using the wrong instruction to compile your code. You are also in the wrong location. Close that command prompt with the exit command and run the following two commands at a new command prompt window:-You can of course use a different folder name. Use the second instruction to move to your java folder whenever you need to do any programming. Now move your XYZ.java file into that folder, and use the following two instructions, remembering which does and which doesn't use an extension:-
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!