Java

From I Do Imaging
Jump to: navigation, search

Introduction

Java is a programming language developed by Sun Microsystems and now owned by Oracle. It is best known for its platform independence: a Java program will run on almost any computer. Java applications can run at the server, installed on the user's machine, or can run completely within a web browser.

Notes

JDK or JRE

Two versions of Java are available: the Java Runtime Executable (JRE), for running Java applications, or the more involved Java Development Kit (JRE), which includes the Java compiler and other development tools along with the JRE. In a Unix environment, at the terminal the commands which java and which javac will tell you if you have the JDK installed - if you have __java__ but not __javac__, you have the JDK. Both will work for running Java applications, but they do determine what downloads you need. The command java version will tell you your installed version: Java 6 has version number 1.6, Java 7 is version 1.7.

In a Windows environment, the test is more involved. This post may help.

JAVA_HOME

You have to run the installation of each of these packages from the path into the JDK (or JRE). If you run the JAI installation from anywhere other than this directory, you'll fail and get an error message that tells you nothing! Determining exactly what this path is, can take a few steps. Here, the path to the JDK is /usr/lib64/jvm/jre-1.7.0-openjdk. Note that this may not be the actual physical path of the JDK, which often contains version numbers. JAVA_HOME is the directory where that where executing bin/java will run the current version of Java.

$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Dec 19 11:11 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 41 Dec 19 11:11 /etc/alternatives/java -> /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java
$ cd /usr/lib64/jvm/jre-1.7.0-openjdk

Security

Java has tight security since it enables the running of downloaded applications. Most applications have to be approved before they are run.

Java Control Panel

System-wide settings control whether unsigned applications can be run (java.com). The __Java Control Panel__, in System Preferences (Mac) or search for 'Java Control Panel' in Windows 7/8) can be configured to allow unsigned applications to run.

See also