$customHeader
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

Step-by-step guide

  1. Download the jdk from the Oracle site - google search jdk download
  2. Extract the tar file to your home 
  3. Move the extracted files which should all be within a folder jdk* to /etc - you can move to another location of your choice but be sure to remember where you put it, let's call this <javaHome> and I have used /etc/jdk1.8.0_51
  4. Set the following environment variables in your .bash_profile - if you don't set these tomcat will not be able to execute JSP files
    1. PATH=./:$PATH:$HOME:/<javaHome>/bin

      CLASSPATH=/etc/<javaHome>/jre/lib/rt.jar
      JAVA_HOME=/etc/<javaHome>/
      JDK_HOME=$JAVA_HOME
      JRE_HOME=/etc/<javaHome>/jre/

  5. You should be able to type java -version and javac -version
  6. Navigate back to your home directory, be sure you are logged in as yourself and not root
  7. Create a file called SmipleTestApplication.java
  8. Add the following lines of code to it
    1. public class SimpleTestApplication
      {
            static public void main( String[] args )
            {
                   System.out.println( "Hello world\n");
            }
      }

  9. Save the file and exit back to the command line
  10. Type the following
    1. javac SimpleTestApplication.java
  11. Now to run it type
    1. java SimpleTestApplication


  • No labels