Thursday, April 23, 2015

Running Java code and setting its environment variable in Windows 7

You may download Java Development Kit here. Accept the license agreement and choose your system. I'm using Windows x64 (for 64 bit, you may also choose Windows x86 to run 32 bit system)



Setting Windows 7 environment variable for Java
To do this:
  1. Open system properties
  2. Advanced system settings
  3. Click on environment variables @ bottom right 
  4. Click 'New' to create new system variable (Variable name: JAVA_HOME, Variable Value: C:\Program Files\Java\jdk1.8.0_45), then click 'ok'.
  5. In system variables, scroll down and look for "path"
  6. Edit the path by append ";%JAVA_HOME%\bin"
  7. Restart cmd
Step 4: Create new system variable

Step 6: Append the path

No comments:

Post a Comment