Setting the path

Updating the PATH environment variable enables AIX® to find Java™ programs and utilities.

About this task

The PATH environment variable enables AIX to find programs and utilities, such as javac, java, and javadoc tool from any current directory. Changing the path will override any existing Java launchers in your path.

To display the current value of your PATH environment variable, type the following at a command prompt:
echo $PATH
To add the Java launchers to your path:
  1. Edit the shell startup file in your home directory. The name of your startup file will depend on the shell you are using; for example:
    • The Korn shell startup file is .kshrc.
    • The C shell startup file is .cshrc.
    • The Bourne shell startup file is .profile.
    • The BASH shell startup file is .bashrc.
    Add the absolute paths to the PATH environment variable; for example:
    export PATH=/usr/java-ppc32-60-srt/jre/bin:/usr/java-ppc32-60-srt/bin:$PATH
  2. Log on again or run the updated shell script to activate the new PATH environment variable.

Results

After setting the path, you can run a tool by typing the tool command name at a command prompt from any directory. For example, to compile the file Myfile.Java, type:
javac Myfile.Java


© Copyright IBM Corporation 2005, 2010. All Rights Reserved.
© Copyright Sun Microsystems, Inc. 1997, 2007, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
This information center is powered by Eclipse technology. (http://www.eclipse.org/)