Sprouts Mac OS
The last 2 hours have been exciting! Thanks to the complexities involved in setting up the Java development environment on Mac OS X (10.8.2) code named as Mountain Lion (latest as of today).
Apple did something nasty after Oracle took over the SUN Microsystems, Apple announced some months back that they are not going to support the further releases of the JDK. As a result the Mac OS now doesn't come with the JRE installed by default. We have to manually install it. If you are a Java developer simply JRE won't suffice, you need to install the JDK (Java Development Kit).
Okay, that's the crappy story behind why this complexity arise now and was not present earlier. Installing JDK 7 is easy on Mac OS X. (Installing JDK 6 is impossible as of now on Mac OS X Mountain Lion, I've done some reading on this and I couldn't find a way - the main reason is Oracle has not released Mac OS compliant JDK 6 installation. If you know installing JDK 6 on Mac OS X, please post it in the comments). The Oracle guide for installing JDK 7 on Mac OS X is pretty clean so I'm not wasting my time in writing something that is already clean and clear. JDK is installed system-wide and you cannot install it on user basis. You also need admin access for this installation. Installing JDK also installs JRE on your system.
For performance reasons, you may want to use a dedicated disk for your virtual machine. https://managedepositrollerofhighdefinitionbljn.peatix.com. https://downaup672.weebly.com/unreal-tournament-3-keygen-reloaded-rar-password.html. This was not straightforward to do with VirtualBox on MacOS, so I decided to write it down and share it with others that may be interested. Support Communities / Mac OS & System Software / Mac OS X v10.3 and earlier. 2008 7:39 AM in response to Jay Sprout In response to Jay Sprout. Chomper deluxe mac os.
To summarize, the steps are:
1. Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html and download the appropriate .dmg file (for me it was jdk-7u9-macosx-x64.dmg).
2. The file will take some time to download, it took me like 30 mins. The file will be downloaded in the Downloads folder, can be accessed through Dock. Double click the .dmg file and a Finder window will appear with a box - double click it too and the installation will start. That's it!! A confirmation window will appear when installation is done.
It's that simple!
What sucks is setting up of $JAVA_HOME!!
It took me more than an hour to figure this out! It's also because I'm pretty new to Mac OS.
Okay so where is JDK exactly installed on Max OS? It's here: /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk
And where is the bin folder of the JDK, it's here:
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/bin
And where the JAVA_HOME should point to?
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
JAVA_HOME should point to the home directory and not the bin folder.
How to set up JAVA_HOME ? The real reason I'm writing this post..
Step 1:
Check out whether you already have set up $JAVA_HOME and $PATH. Remember the letters should be capital. Open the terminal and type the following commands
echo $PATH
These will print out the current values of $PATH and $JAVA_HOME. You would probably have some value for your $PATH but it will be blank for $JAVA_HOME.
Step 2:
$PATH and $JAVA_HOME should be present in your .profile file. This file is present in your home folder - it is the place where your terminal opens by default. If .profile file is not present you have to create it! This is the trickest part but it is simple!! Following are the steps:
- Open your terminal and type the command vi .profile This will open the .profile file and if not present will create it.
- Paste the following in the file
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home;
PATH=$PATH:$JAVA_HOME;
- Write & quit the file by typing :wq
Now, try to see the values of the $PATH and $JAVA_HOME as specified in the Step 1. In my case they show the following values:
echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
Step 3:
Verifying everything. Just once command will verify everything:
$JAVA_HOME/bin/java -version
If this command gives you the Java version that you installed, then you are good to go! In my case it prints out