I was trying to set up Fedora Object Repository for my assignment which need some environment variable to be set especially Java. I posted blog on how to choose Java VM in Ubuntu. Location of Java in Mac OS is different from linux or ubuntu.
Java home path in Mac is:
To set the environment variable is:
Bear in mind that issuing ‘export’ command from the terminal is only meant for that terminal only. The environment variable is not being set globally. So in order to define the environment variable so whole Mac application is able to see them.
- Create a folder in the user root directory called .MacOSX
- Create a file called environment.plist in the directory, so when you issue pwd command you will see /Users/lindaoctalina/.MacOSX/environment.plist
- In environment.plist, create an xml document with the following format:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Note: you must use full path instead of ~ for home directory
- Log out and log back in whenever you modify environment.plist to see the changes