Skip to content

Installation: Java 7

randikathryn edited this page Feb 17, 2014 · 8 revisions

Notes

The Java 7 runtime environment is required to run Tomcat, Fedora, and Solr.

Steps

  1. Verify that Java 7 is installed by entering the command which java in the terminal window. This should return /usr/bin/java. Additionally, entering java -version should return java version 1.7.x. If Java 7 is installed, proceed to Step 3.

  2. If Java 7 is not installed, use your package manager to install it.

    Ubuntu:
    sudo apt-get install openjdk-7-jdk

    CentOS:

    1. Enter the command sudo yum install java-1.7.0-openjdk-devel in the terminal window.

    2. Type Y when asked "Is this ok [y/N]".

      The final output should look like this (with the ... indicating system generated code that has been intentionally left out of these instructions):

      [user.ip.address] sudo yum install java-1.7.0-openjdk-devel
      ...
      Transaction Summary
      =============================================================================
      Install: 15 Package(s)
      Total download size: 38 M
      Installed size: 134 M
      Is this ok [y/N]: Y
      ...
      Complete!

  3. You now need to configure your machine to use Java 7. Enter the command sudo update-alternatives --config java in the terminal window. You will see all available versions of Java. Select Java 7. The final output should look similar to this:

    There is 1 program that provides 'java'.

    Selection Command
    -----------------------------------------------
    *+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

    Enter to keep the current selection[+], or type selection number: 1

Verification Steps

Enter the command java -version in the terminal window. This should return java version 1.7.x.

Next Step

Proceed to Install Tomcat or return to the Overview page.

Clone this wiki locally