Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Scott Allen

Greenhorn
+ Follow
since Jan 29, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Scott Allen

Campbell Ritchie wrote:I have added a warning to the FAQ against using a user JAVA_HOME and a system PATH.



Thanks! I, for one, am both grateful for the assistance I received as well as to find out that I didn't just make some stupid mistake.

Scott
9 years ago

Joydeep Ghatak wrote:

1. Put the path as: C:\Program Files\Java\jdk1.6.0_23\bin; [ I mean the complete path where JDK is installed in your machine] at the beginning of the PATH environment variable, instead of using through JAVA_HOME, initailly

2. Then open a new command prompt window to check the 'java' and 'javac' command.

3. Also please check the 'Java' version that you have downloaded is for 32 bit or 64 bit and what is the architecture of your machine.

4. Also as per your post, you have set the 'JAVA_HOME' as 'User variables' and PATH is present in 'System variables' section.
I am not sure if there is any specific reason for you to put 'JAVA_HOME' as 'User variables', but my suggestion will be to put both JAVA_HOME and PATH under 'System variables' section.



OK - looks like we have a winner.

1. Done.
2. I did this and it now works - when I enter javac -version as a command prompt, it returns
javac 1.6.0_23. javac appears to return non-error related information that I'll understand at some point in the near future
3. 32 bit was downloaded, system has been confirmed as 32 bit as well.
4. The tutorial on creating your first Java program stated:
"You can set environment variables for either your user only, or for all users (System variables)". Per your recommendation, I went ahead and moved this to the System variables. All functionality seems to still work after this change.

Everything seems to be working now, but I'm sure I'll be back in the near future with more stuff I can't figure out.


Scott
9 years ago
Confirmed. C:\Program Files\Java\jdk1.6.0_23\bin contains javac.exe.

Thanks,
Scott
9 years ago
Thanks so much for the assistance - I'll get this down yet. Let me address the responses thus far:

"So once you have set your PATH variable- You need to re-enter/exit and start the command prompt. So that the environment variables are recalculated."

- I did this, but it didn't make any difference.

"The other possibility is that Scott Allen has mistakenly downloaded a JRE instead of a JDK. Please check. It is easily done. You should be able to tell from the name or size (JDK ≅ 76MB, JRE ≅ 16MB) of the file it was installed from."

- I double-checked, and I definitely downloaded the following:
Java SE Development Kit 6u23 (jdk-6u23-windows-i586.exe), 76.3 MB

Thanks!
Scott
9 years ago
Hi All,

I just started trying to learn Java a couple of hours ago, so I'm about as green as you're going to find. I have no other programming experience - the closest I've come is some html several years ago.

At this point, I have:
- begun reading Head First Java
- downloaded and installed Java jdk1.6.0_23
- followed the instructions on the "How to create your first Java program" page on this site
- set the JAVA_HOME and PATH environment variables as follows:
- User variables: JAVA_HOME C:\Program Files\Java\jdk1.6.0_23
- System variables: Path %JAVA_HOME%\bin; placed at the beginning of the Variable value field

So when I go to my command prompt and type in "javac" (quotations not included in my command prompt entry), I get the following:
- 'javac' is not recognized as an internal or external command, operable program or batch file
I have the same issue when I type "javac -version".

When I enter "java", it spits out a bunch of stuff that doesn't make sense to me (yet). When I enter "java -version", it says:
java version "1.6.0_23"
Java(TM) SE Runtime Environment <build 1.6.0_23-b05>
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)

My question, then, is why am I getting the error message when I enter "javac" but not when I enter "java"? Please note that I have no clue what the difference is between "java" and "javac".

If additional information is needed in order to assist, please let me know. I'll be checking in here tomorrow morning (past my bedtime) and hopefully I'll be able to figure out what I'm doing wrong.

Thanks in advance for any and all assistance. It's kind of frustrating to hit a roadblock this early in the game, but it's important to me that I set things up properly and that I understand everything as I move forward.

Best regards,
Scott
9 years ago