0How To Permanently Set Path Using Environment Variables In Java?

Posted by Harwinder Kumar at 8/16/2011 Posted in:

This post is for those java programmers who are just newbies in this language! After installing JDK, next step is to set path in DOS for compiling your first program in Notepad.

Note: I am not telling about Netbeans where you don't need to set any path. 

Before compiling your program written in Notepad, you need to set path every time after opening command prompt. It means path you set in command prompt is not permanently stayed here. Follow these simple steps for permanently set path using environment variables:
  • Go to Java installation's Bin folder in Program files & copy the whole path from address bar. For e.g.C:\Program Files (x86)\Java\jdk1.6.0_03\bin
  • Now go to start> run> Type sysdm.cpl> In System Properties> Go to Advanced tab> Click on Environment Variables placed on right bottom side.
  • In System variables look for "Path".
  • You will see several variable values.
  • Paste the path you copied from address bar followed by ; in variable value as did in screenshot:

    Set Path In Java
  • That's all.
  • From now, you don't need to set path every time before compiling your program.
If you are using Linux, then you don't need to set any path. Simple compile & run your program with javac & java.

Note: For installing Java in ubuntu, check my other post: How To Install Java In Ubuntu?
Hope You Liked It. Receive Latest Posts Directly To Your Email
Get Free Updates:
Click On The Confirmation Link Sent To Your Inbox Or Spam

0 comments so far:

We love to hear from you! Leave us a comment:

© 2014 Learn The Basics Of Ethical Hacking About | Site Map | Privacy Policy | Contact