Wednesday, May 27, 2015

Step by Step Install / Uninstall JDK 8 on OS X Yosemite

Step by Step Setup / Install of Java SE Development Kit 8 on OS X Yosemite

Download the Java SE Development Kit 8
Open Browser and proceed to Oracle's Java SE Downloads page

Click JDK DOWNLOAD button to goto the Java SE Development Kit 8 Downloads page
You must accept the Oracle Binary Code License Agreement for Java SE to enable links for downloading the JDKs.
Select the Accept License Agreement radio button and then will be prompted the message: Thank you for accepting the Oracle Binary Code License Agreement for Java SE; you may now download this software. You are now ready to download the binaries by clicking the corresponding Download link e.g. jdk-8u60-macosx-x64.dmg


Install Java SE Development Kit 8
Open the installer by double-clicking the downloaded Apple Disk Image file e.g jdk-8u60-macosx-x64.dmg










Double-click the pkg icon e.g. JDK 8 Update 60.pkg icon to start installation.















You will be prompted with Welcome to the JDK 8 Update Installer screen. Press the Continue button.
















You will then be prompted with the start of the installation confirmation screen. Press Install button.
















You will be prompted to enter administrator credentials in order to continue with the installation. Enter Password and press Install Software button to continue with the installation.













Follow installation instructions and press Close when 















You will be prompted with the installation was completed successfully screen and press Close button to finish installation. 















Once completed, set environment via ~/.bash_profile

$ export set JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
 
 

Verify Installed JDK
Verify installed JDK via java -version command.
 
$ java -version
 
java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
 

Uninstall an existing JDK
List installed Java Virtual Machines via ls command

$ ls /Library/Java/JavaVirtualMachines
jdk1.8.0_51.jdk    jdk1.8.0_60.jdk



To uninstall an existing JDK, issue rm -rf /Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk command for a specific jdk e.g jdk1.8.0_51.jdk
 
$ sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk
Password:*
 
 

Setup / Install Tomcat 8 on OS X Yosemite

#Download latest tomcat
 
#Create /usr/local 
sudo mkdir -p /usr/local
 
#Goto directory to /usr/local
cd /usr/local


#Extract downloaded tomcat from the /usr/local
tar -zxvf ./apache-tomcat-8.0.45.tar.gz 
sudo ln -s /usr/local/apache-tomcat-8.0.45 /Library/Tomcat 
 
#Remove existing tomcat directory
sudo rm -f /Library/Tomcat


#Create symbolic link for easier access
sudo chown -R  /Library/Tomcat
sudo chmod +x /Library/Tomcat/bin/*.sh
 
#configure gui admin for tomcat via /Library/Tomcat/conf/tomcat-users.xml include inside 
  
  
   
 
#Start tomcat from terminal
/Library/Tomcat/bin/startup.sh
 
#Stop tomcat from terminal
/Library/Tomcat/bin/shutdown.sh