The instructions on this page are intended for advanced users or system administrators.
PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.PATH environment variable. Click OK. Close all remaining windows by clicking OK.PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.PATH environment variable. Click OK. Close all remaining windows by clicking OK.PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.PATH environment variable. Click OK. Close all remaining windows by clicking OK.PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.PATH environment variable. Click OK. Close all remaining windows by clicking OK.To run a different version of Java, either specify the full path, or use the java_home tool:
% /usr/libexec/java_home -v 1.8.0_73 --exec javac -version
% java -versionjava tool, if it can find it. If the version is old or you get the error java: Command not found, then the path is not properly set.
% which javaTo set the path permanently, set the path in your startup file.
Note: Instructions for two most popular Shells on Linux and Solaris are listed. If you are using other shells, see the Path Setting Tutorial.
Edit the startup file (~/.bashrc)
PATH=/usr/local/jdk1.8.0/bin:$PATH
export PATH% . /.profile
java command% java -versionEdit the startup file (~/.cshrc)
set path=(/usr/local/jdk1.8.0/bin $path)% source ~/.cshrc
java command% java -version
Select Language
| About Java
| Support
| Developers
| Feedback
Privacy
|
| Terms of Use
| Trademarks
| Disclaimer