Seeing Environment Variables from Command Line in Windows 7

Whenever I get a new machine, I always end up installing Java.  After the install, I like to bring up a command line and type “java -version” as a quick way to validate the installation. About half the time that does not work as I have either forgot to set my JAVA_HOME environment variable or (more likely) add “%JAVA_HOME%\bin” to my PATH environment variable.

At this point, I want to see the specific environment variables.  Instead of going through Control Panel -> System -> Advanced System Settings (too many clicks) I want to just see them in my command shell.

This is documented all over the Internet, but I wanted to have this here for my own reference as it is really easy, yet I often forget it:

C:\>set JAVA_HOME

This will display:

JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_30

Perfect!  Now I can see the environment variable value.

Advertisements

About stevewall123

I am a Lead Software Engineer in Minneapolis working for Thomson Reuters. I am currently working on projects using Java, JavaScript, Spring, Drools, Hazelcast, Liquibase and Tomcat. Previously, I used C#, GWT, Grails, Groovy, JMS and JBoss Drools Guvnor. In the past I have worked on projects using J2EE, Swing, Webwork, Hibernate, Spring, Spring-WS, JMS, JUnit and Ant.
This entry was posted in Miscellaneous and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s