I recently got my book Head First Java, which tells me I need to set up JDK in order to do code at the command line. But the book doesn't go about how to do that in well enough detail. I found the set up guide here Guidebut I am still having trouble. I feel like I set everything up correctly but there is still something off. I set the path as it described and I tried to do a version test to see if it was set up correctly, but it just says "javac is not recognized...." I don't know if I am trying to check the version in the wrong place, or if I am using cmd wrong (I never did programs in cmd I always used BlueJ in class). I attached pictures to show what I've been trying to do. If you have any suggestions / help I would greatly appreciate it. Thank you.
I got it to work by doing some extra digging. First I updated to the latest version, then I changed the %JAVA_HOME%\bin to the direct path C:\Program Files\Java\jdk1.8.0_91\bin. I ran the javac -version at command and it returned fine.
Java is backward compatible, so even if you use the latest version (Java 8) then everything in the book will still work if it's using Java 5.
A book about Java 5 is still OK if you want to learn the basics, but a lot of new stuff has been added to Java 6, 7 and 8 so at some point you'll want to learn the new stuff, which will not be in your book about Java 5.
And welcome to the Ranch and have fun learning Java!
Sophi Rose wrote:I got it to work by doing some extra digging. First I updated to the latest version, then I changed the %JAVA_HOME%\bin to the direct path C:\Program Files\Java\jdk1.8.0_91\bin. I ran the javac -version at command and it returned fine.
And you just got your first cow for a greatly presented question from the beginning and for finding the solution on your own