Skip to content

Instantly share code, notes, and snippets.

@Ahmedsaka
Last active September 2, 2019 23:54
Show Gist options
  • Save Ahmedsaka/612a7819dbc2bec62756d7a076962c30 to your computer and use it in GitHub Desktop.
Save Ahmedsaka/612a7819dbc2bec62756d7a076962c30 to your computer and use it in GitHub Desktop.
How to add an environment variable for your java jdk unix OS
open the terminal, make sure you are in your home directory
run the following
=>ls
find the and open the .bash_profile file in an editor with "open -e .bash_profile file",
if not create using => "vim ~/.bash_profile"
enter : "export $JAVA_HOME=$(/usr/libexec/JAVA_HOME)"
run => source ~/.bash_profile
To verify the environment variable was been created, run => "echo $JAVA_HOME"or "export | grep JAVA"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment