Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Go to the Java website, choose the JRE based on your platform,  download the requisite .bin files and upload them to your home folder:su - serveradmin # If you are not already serveradmin
cd ~ # Switch to the serveradmin home directory
chmod +x jre-6u16-linux-i586.bin
./jre-6u14-linux-i586.bin # Decompresses JRE to the current folder under jre1.6.0_16.
mv ./jre1.6.0_16 ./java
mkdir apache
mv ./java ./apache/

(tick)

Shawn took an interesting approach and further stripped down Tomcat. Ask him for details on this.

The purpose of the serveradmin account is to run Tomcat and java. As such serveradmin can not sudo into root. In the event that Tomcat is somehow attacked serveradmin would be compromised. Not allowing serveradmin access to sudo provides an extra layer of security.

Log in as your staff account which has sudo access to perform the actual move to /opt/cd /home/serveradmin
sudo mv ./apache/ /opt/

(warning)

If you go with 64-bit Java (which I recommend against as it's way slower right now) I find it useful to add to the default folder name _64-bit so in that case it would be, jre1.6.0_16*_64-bit*.

For Solaris, use the sh file, and move it into opt and run it.

You can also do something very similar with my Windows instructions.

For older versions go to the  Java Archives site64-bit JRE (Java Runtime Engine). Download the .tar.gz file and upload the file to the serveradmin home folder. For older versions of Java go to the Java Archives site.

Use the account that will be launching the Java process. In this example it will be serveradmin,

Code Block
languagebash
su - serveradmin # If you are not already serveradmin
cd ~
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn/java/jdk/7u7-b10/jre-7u7-linux-x64.tar.gz

The steps for JRE and JDK are both the same. Here is an example of a JRE setup,

Code Block
languagebash
su - serveradmin # If you are not already serveradmin
cd ~ # Switch to the serveradmin home directory
tar -xvpf jre-7u7-linux-x64.tar.gz

The result will be an uncompressed jre directory using the same name as the package. In this example the folder name would be, jre-7u7-linux-x64.

If you plan to use multiple versions of Java, we recommend keeping the folder name with the version number information and using symbolic links. If you are only using one version of Java, then simply rename the folder.

For the server example, we will rename the folder,

Code Block
mv jre-7u7-linux-x64 java
Tip

You may be interested in how to Zero Footprint Java on Windows.