Commits

Ilias Romanos committed 4abc90b

Added a section about using Oracle's Java.

Comments (0)

Files changed (1)

  
 Now go to your `~/webapps/<app_name>/bin/catalina.sh` file and find the line where it only says FORCE=1 and change it to FORCE=0. It should be located around line 416.
 
+### Install Oracle's JDK ###
+
+All WebFaction servers come with OpenJDK pre-installed:
+
+    $ which java
+    /usr/bin/java
+    $ java -version
+    java version "1.6.0_24"
+    OpenJDK Runtime Environment (IcedTea6 1.11.5) (rhel-1.50.1.11.5.el6_3-x86_64)
+    OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
+
+If you want to use Oracle's JDK with your Tomcat instance, here's what you do:
+
+1. Visit [Oracle's Java download page][8] and click to download the latest Java Platform (JDK) version. 
+2. On the next page, copy the url of the appropriate product to your clipboard. Select the 'Linux x86 tar.gz' file if you are on a CentOS 5 (32-bit) machine, or the 'Linux x64' file if you are on a CentOS 6 (64-bit) one.  
+3. Open an SSH session to your account. See WebFaction's [Accesing Your Data][9] if you don't know how.
+4. Create a directory to place Java and traverse to that directory. Enter `mkdir ~/opt && cd ~/opt` and press `Enter`.
+5. Download the JDK and decompress it. Enter `wget -O - --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "URL" | tar xz`, where URL is the one you've copied, and press `Enter`.
+6. Create a symbolic link for easier easier reference. Enter `ln -s jdk1.7.0_09/ java` and press `Enter`.
+8. Add `~/opt/java/bin` to your PATH enviromental variable. Enter `echo 'export PATH=$HOME/opt/java/bin/:$PATH >> $HOME/.bashrc` and press `Enter`.
+9. Make your .bashrc changes take effect. Enter `source ~/.bashrc` and press `Enter` 
+
+You should now be using Oracle's JDK:
+
+    $ which java
+    ~/opt/java/bin/java
+    $ java -version
+    java version "1.7.0_09"
+    Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
+    Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
+
+If you want to use Oracle's JDK with your Tomcat instance change the JRE_HOME enviromental variable in your `~/webapps/<app_name>/bin/setenv.sh` from:
+
+    JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64
+
+or, on 32-bit machines, from:
+
+    JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk
+
+to:
+
+    JRE_HOME=$HOME/opt/java
+
+And restart your Tomcat instance.
+
 [1]: <http://wiki.nginx.org/Main> "nginx's website"
 [2]: <http://tomcat.apache.org/tomcat-7.0-doc/index.html> "Tomcat documentation"
 [3]: <https://bitbucket.org/kboi/webfaction-tomcat-installer/issues> "Project's issue tracker"
 [5]: <https://my.webfaction.com/new-application/> "Add new application form"
 [6]: <https://bitbucket.org/kboi/webfaction-tomcat-installer/raw/default/TomcatInstall> "TomcatInstaller URL"
 [7]: <http://docs.webfaction.com/user-guide/websites.html#create-a-website-with-the-control-panel> "Create or modify a website entry"
+[8]: <http://www.oracle.com/technetwork/java/javase/downloads/index.html> "Oracle's Java 
+[9]: <http://docs.webfaction.com/user-guide/access.html> "Accessing Your Data"