aspose file tools*
The moose likes Java in General and the fly likes EE javac Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "EE javac" Watch "EE javac" New topic
Author

EE javac

Alex Cholakis
Greenhorn

Joined: Oct 20, 2009
Posts: 8


I need to set an Environmental Variable:
JAVA_HOME = C:\Program Files\Sun\SDK\jdk\bin

I want to do this from the window interface, so I went into my Environmental Variables. There are two windows:
"User variables for Computer" and "System variables"
1) Where do I place this variable?

After I create and give the variable a value.
2) How do I add it to the "System variables" "PATH" variable?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

JAVA_HOME should be the root of the installation, not the bin directory.

It doesn't matter if you put it in user or system variables.

You set the path in much the same way; under the computer's properties.

You might want to check out some basic Windows documentation for things like this, since it's not really Java-related per se.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

Alex Cholakis wrote:1) Where do I place this variable?

User variables if you want them for only you, system variables if you want them for everyone.

2) How do I add it to the "System variables" "PATH" variable?

1) double click on PATH
2) copy the value to a text editor
3) put word wrap on
4) add %JAVA_HOME%\bin to your path
4a) put %JAVA_HOME%\bin; at the start, or
4b) put ;%JAVA_HOME%\bin at the end, or
4c) put ;%JAVA_HOME%\bin just after some other path (but before its following ;)
5) copy the line back to the value field
6) press OK

Steps 2, 3 and 5 are there because it's just not useful editing such a long string in such a small field.

Here's a filtered part of my PATH:
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;%JAVA_HOME%\bin;%ANT_HOME%\bin;C:\Program Files\Support Tools\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\GTK\2.0\bin

Note the position of both %JAVA_HOME%\bin and %ANT_HOME%\bin - just after the Windows system paths, to make sure that no other javac will be used because its path is found first.
Alex Cholakis
Greenhorn

Joined: Oct 20, 2009
Posts: 8
Hi: SUCCESS!

Previously, I used the SE edition of Java. This is the first time using EE or Enterprise edition. So, there was alittle difference here. I've been experimenting and emailing over different list. This is my first time on this Forum and it is a super resource.

Rob, what I did was to go into my Environmental Variables and into the System variables window. I set a variable JAVA_HOME with the value "C:\Program Files\Sun\SDK\jdk" and then placed this in the Path as ;%JAVA_HOME%\bin at the end.

Your explanation was super and I learned the "%" is part the windows operating system symbols.

And David, if you hava a link about learning more about the windows symbols, it be much appreciated.

Thank you both for taking the time to respond. You made my day.

Best,
Alex
 
 
subject: EE javac