How to set the javapath in mac terminal?

0 votes
27 views
asked Apr 18 in JAVA by admin (8,115 points)
Hi All,

  Need quick help to set the java path in mac terminal.

1 Answer

0 votes
answered Apr 19 by anonymous

Setting the JDK Path on Mac OS X or Linux for Your User

  1. Login and open a Terminal or command line window
  2. Open the ~/.bash_profile using vi or another command-line editor such as Pico. For example enter vi ~/.bash_profile.
  3. Set your PATH to include the JDK sub-folder named java. For example: export PATH=$PATH:/usr/java/jdk1.6.0_10/bin
  4. Save the changes and either logout and then back in, or, to active the new settings enter source ~/.bash_profile
...