Sign in with
Sign up | Sign in
Your question
Solved

What do I put in the system variable PATH for Java commands?

Last response: in Windows 7
Share
January 21, 2013 3:52:12 PM

I want to set up a server using java on my new computer that I built, but my computer doesn't recognize any Java commands even though I re-installed it twice. SO I looked at Java's tutorial, but they did not mention the location of the class or were to find the location of the class. I might not understand what they mean (Because I'm 13). But I'm staring at the Variable value slot thinking I wonder what goes here, so please help.
Thank you for reading my question.
a b $ Windows 7
January 21, 2013 4:29:52 PM

(assuming you're in Windows)
Open Control Panel, System, Advanced, and click on Environment Variables
In "User Variables", add (or edit, if it's already there) PATH variable to read
PATH=%PATH%;<full path to folder where you have installed Java>
e.g. PATH=%PATH%;"C:\Program Files\Oracle\Java\JDK". You might need to log-off / log-on for changes to take effect.
To confirm it works - open Command prompt, and type "JAVA". You should get it display something.
And boy, keep on going!
January 21, 2013 4:35:16 PM

I don't know what folder Java is installed in would it be the same as what you put. Also yes I am using win 7..
Related resources
January 21, 2013 4:50:39 PM

Also I tried what you put for the variable value, and I restarted but didn't work. I was a little bit confused by what you meant by PATH=%PATH% is that the new variable name?
a b $ Windows 7
January 21, 2013 7:03:19 PM

Hi

can you explain what you mean by
'I want to set up a server using java on my new computer'

what server program ?

what java commands ?

answer this an some one may be able to see why you are having problems

also what version of java did you install (give file name)
There is a developers version and runtime version which most people use
(as well as 32 bit & 64 bit versions, most people just need the 32 bit version)

the Java 7 runtime on a 32 bit windows is installed by default c:\Program Files\Java\jre7\bin

regards

Mike Barnes
a b $ Windows 7
January 21, 2013 7:03:22 PM

I am not a Java expert (in fact, I hate it and don't use it unless absolutely necessary, and then I go to Linux version), so I just downloadd latest JDK v7.11, and started the installation. The default path offered is
C:\Program Files\Java\jdk1.7.0_11\
so the PATH variable would look
%PATH%;"C:\Program Files\Java\jdk1.7.0_11\
So, to find the exact path - open your Windows Explorer, navigate to C:\Program Files, and drill down until you find something looking like JDK. If your windows is 64-bit version, you have to download 64-bit version of Java as well.
a b $ Windows 7
January 22, 2013 1:28:37 AM

Check to see whether this path actually exists. There is a chance that JAVA.EXE is within a folder of JDK folder (like BIN), so you might have to append "bin\" to the above path.
If you still cannot figure it out - open Windows explorer at the above path, set view to "List" (so we can see as many files as possible), and put another screenshot.
a b $ Windows 7
January 22, 2013 6:42:47 PM

Hi

c:\program files (X86)\Java\

looking at your picture that is the location for the 32bit version of programs on a Windows 64 bit system
[64 bit program files go in c:\program files\Java on a 64 bit system]


on my 32bit Windows & Java version of JRE
C:\program files\Java\jre7\bin is where the executable programs and dlls are located so would be in the %path%
eg
C:\program files\Java\jre7\bin\Java.exe


regards

Mike Barnes
January 22, 2013 10:50:08 PM

I tried that it didn't work.

Best solution

a b $ Windows 7
January 23, 2013 4:07:29 PM
Share

@Palidrome,

Open Windows Explorer. In the search box, enter "Java.exe" (without quotes), and see which folder this file resides in. Enter that folder at the PATH command.
January 23, 2013 8:48:43 PM

Thank you so much that worked now I have a server for me and my friends! :) 
January 23, 2013 8:48:45 PM

Best answer selected by Palidrome.
!