This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!

Daniel Bosch

+ Follow
since Oct 03, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniel Bosch

Thank you Jeff Verdegan! I knew it was something simple like that... After setting JAVA_HOME as a System variable, everything worked fine in the command prompt. And Campbell Ritchie, I did read through that topic... But for some reason, I failed to understand what it was I was supposed to do... :\ Fred Rosenberger, I will keep that in mind. Hopefully I won't have to do much with paths later on because I feel like I'm bound to mess something up. Thank you all for helping me out!

(And another question that has nothing to do with Java... I see there's a "Resolved" button at the top of this page. Since my problem is solved, am I supposed to click that button? Sorry; I'm new to this whole internet forum thing)
5 years ago
I executed "echo %PATH%" in the command prompt, and a whole bunch of stuff was returned. But I did see "%JAVA_HOME%\bin" shown at the beginning, and the %JAVA_HOME% environment variable leads to the JDK's folder... I made sure of that. What was supposed to happen (or, more fittingly... What was I supposed to notice) when I executed the "echo %PATH%" command in the command prompt? (Or was I not supposed to execute that in the command prompt...?) So I'm not sure what I should be looking for. Should I be setting the %JAVA_HOME% variable as "C:\Program Files\Java\jdk1.7.0_07\bin" instead of "C:\Program Files\Java\jdk1.7.0_07"...? The only reason why I didn't do this was because I thought that since the "Path" environment variable has the %JAVA_HOME% variable leading to the jdk1.7.0_07 folder, and then from there looking into the bin folder, I didn't think I needed to include "\bin" to the end of the %JAVA_HOME% environment variable.

Ugh... I feel like I'm missing something really simple here, and you people are trying to explain it to me but I'm just not seeing it...
5 years ago
Thanks for the welcome, Campbell Ritchie! I also read the entire FAQ that you provided a link to prior to posting this thread, but I did what it said and either I don't understand what it's trying to tell me or I missed something that I was supposed to do. In response to your help...

1.) Yes, there is a jdk1.7.0_07 folder located in the Java folder. I made sure that I was in Program Files and not some other folder as well.
2.) Inside that folder, there is a bin folder with a lot of stuff that seems really complicated inside it...
3.) Yes, there is an executable javac file in there.

I don't really understand your last piece of advice though; I have a user environment variable "JAVA_HOME"... Am I supposed to put "JAVA_HOME" as a system environment variable, and "Path" as a user environment variable...?

EDIT: And I ran command prompt, and for some reason, "java -version" worked and it told me the version of Java I had... But "javac -version" did not.
5 years ago
Thank you for replying! I changed the JAVA_HOME variable to "C:\Program Files\Java\jdk1.7.0_07" and kept the "Path" variable the same because I didn't know if I should change that or not, so the "Path" variable still has "%JAVA_HOME%\bin" at the beginning of it. I exited out of the existing command prompt and tried it again, typing in javac in the new command prompt window, and it still says that 'javac' is not recognized... Am I still doing something wrong? jdk1.7.0_07 is the JDK, correct...? Sorry; I'm probably messing up something really simple... =_=
5 years ago
Alright, I just started trying to learn Java, and I'm using the Java Head First (2nd Edition) book to help me learn. One of the things it tells me to do is "add an entry to your PATH environment variable that points to the /bin directory". I already installed Java 7. The bin directory is located in: C:\Program Files\Java\jre7. I went to Control Panel and got to the Environment Variables window, and from there I proceeded to make a User Name variable called "JAVA_HOME" like this site suggested, with the Value set as "C:\Program Files\Java\jre7". Then, I proceeded to edit the System variable "Path", with "%JAVA_HOME%\bin" as the name (without the quotation marks of course), and I placed this at the beginning of the Value without deleting any of the pre-existing text that was already there. I made sure to include a semicolon after the %JAVA_HOME%\bin. When I ran command prompt and typed in "javac", it gives me this message:

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

Apparently, I'm not supposed to get this message... At least, I don't think I should be getting it. I restarted my computer to see if that would change anything, but it didn't. I triple checked the values of the environment variables to see if I made a typo, but I failed to find any. I looked through many of the topics related to this problem, but I can't make heads or tails of any of the information provided... Can someone please help me? I apologize for the stupid question and for my ignorance ... :\

By the way, I'm running Windows 7 64-bit, if that makes any difference at all... Any help is greatly appreciated!
5 years ago