• Post Reply Bookmark Topic Watch Topic
  • New Topic

enviorment variables - javac -version  RSS feed

 
Toni Wilkinson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I know there is a lot of these type of posts on here. but I have read through what I can find, and have tried things and nothing is working

1: I have downloaded Java JDK version - jdk1.7.0_04
2: I have Windows 7 64bit
3: I have created my JAVA_HOME variable under sytems variables.
4: my 'path' variable is: C:\Program Files\Java\jdk1.7.0_04;\BIN;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\EgisTec MyWinLocker\x86;C:\Program Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\QuickTime\QTSystem\;
(Is this missing something?)


5: I type Java -version i get the following:
java "version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java Hotspot (TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

however when i type javac -version:
'javac' is not recognised as an internal or external comman, operable program or batch file.

I have also tried restarting my machine.

I am sure im doing something blantantly obvious....but what..?

Please note I am new to Java programming, so may need things simple, I have experience in HTML and action script and sql only.

Help!
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Toni Wilkinson,

Welcome to CodeRanch!

When a command is issued on command (or cmd) prompt, Windows searches it in PATH(not path) variable. When you install JDK, by default, javac.exe lies under "C:\Program Files\Java\jdk1.7.0_04\bin" (or under "C:\Program Files (x86)\Java\jdk1.7.0_04").

Hence, those directories must be part of PATH variable, which is not the case as of now.

Also, please take care to include those directories under quotes (especially when directory path contains a space - like 'Program Files'), and please make sure that you are modifying existing PATH variable, instead of creating a new 'path' variable.

I hope this helps.

By the way, what is '/BIN'? I can see that in your PATH variable (though it does not seem to be related to this issue).
 
Toni Wilkinson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I do not have a PATH systems variable only path. or PATHEXT.

also - so I actually need to type "?

and as for the\bin in the path: I dont know, all I can say is, i originall put "%JAVA_HOME%\bin;" (without the double quotations). at the bignning as per step 7 in the FAQ's on this. but then read somewhere to try full path so put C:\Program Files\Java\jdk1.7.0_04;\BIN;%

im not sure what all the rest means - did download strawberry for perl once, but never used it....got rid of the references to it in the path...

 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First:
C:\Program Files\Java\jdk1.7.0_04;\BIN
Remove the ";" between the jdk1.7.0_04 and \BIN.

Second:
Close your open CMD prompt and re-open it. The Environmental Variables are only loaded when the command environment is launched, so changes you make when the prompt are open are not seen. If that doesn't work, restart the computer to make sure they get applied and read.

Finally:
If the above doesn't work: navigate to C:\Program Files\Java\jdk1.7.0_04\BIN and see if that path actually exists, the javac.exe executable is in it, and that the user you are running Windows as has read-access to that path.
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve Luke wrote:Close your open CMD prompt and re-open it.

I missed to mention that

Thanks Steve Luke for pointing it out.
 
Toni Wilkinson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sweet, it was that pesky semi colon!

Ta very much.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome Toni,

As another hint, you should not use "Program Files" at all.

It may be too late now, but I get everyone on my team to override the windows installer default,
and install to something like c:\java\jdk_1.7 etc...

windows spaces in folder names was/is imho one of the worse things ever.

WP
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!