I’ve been using Linux (specifically Ubuntu) for quite some time now, I’ve been trying to migrate to Linux from windows. One of the first thing I’ve encountered is adding an environment variable. Compared to windows, its very similar, only that you have multiple ways to do it. One way I find to be the easiest is by adding it to /etc/environment file. So here’s how to do it.
/etc/environmentas root in GEdit (or any text editor you have)1sudo gedit /etc/environment
Add the following lines (remember to change the version to what you are also using).1JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun"
Save it and log-off or restart you machine, that’s it!
You can also add other variables like your
MAVEN_HOME or anything you want.