From Documentation
Jump to: navigation, search
m (Trouble Shooting)
(Trouble Shooting)
Line 26: Line 26:
 
'''Fix''':  Install the Java 8 (or appropriate version) in your home directory.  To install Java 8, perform the following steps.<br>
 
'''Fix''':  Install the Java 8 (or appropriate version) in your home directory.  To install Java 8, perform the following steps.<br>
  
(1) Download the Java8 64 bit JRE tar file from oracle (jre-8u25-linux-x64.tar.gz).
+
(1) Download the Java8 64 bit JRE tar file from oracle (jre-8u25-linux-x64.tar.gz).<br>
(2) If you have not previoulsy done so, create a package sub-directory in your home directory (mkdir ~/package).
+
(2) If you have not previoulsy done so, create a package sub-directory in your home directory (mkdir ~/package).<br>
(3) Copy the tar file into this directory, and extract it using the following command 'tar zxvf ~/package/jre-8u25-linux-x64.tar.gz -C ~/package/'
+
(3) Copy the tar file into this directory, and extract it using the following command 'tar zxvf ~/package/jre-8u25-linux-x64.tar.gz -C ~/package/'<br>
(4) Add the following to the end of your ~/.bashrc file 'set PATH=~/home/package/jre1.8.0_25/bin:$PATH'
+
(4) Add the following to the end of your ~/.bashrc file 'set PATH=~/home/package/jre1.8.0_25/bin:$PATH'<br>
(5) Verify the installation by logging into a development node and executing the following line 'java -version', you should see.
+
(5) Verify the installation by logging into a development node and executing the following line 'java -version', you should see.<br>
  
 +
<pre>
 
java version "1.8.0_25"
 
java version "1.8.0_25"
 
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
 
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
 
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
 
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
 +
</pre>

Revision as of 10:13, 6 January 2015

OPENJDK
Description: Open source implementation of Java SE.
SHARCNET Package information: see OPENJDK software page in web portal
Full list of SHARCNET supported software


Introduction

Java is a general-purpose, object-oriented language which is designed to have few platform dependencies. Both the runtime environment and development tools are installed on SHARCNET clusters. The purpose of this article is to assist the user in deploying, executing, and trouble shooting Java programs on SHARCNET.

Related Pages

Deployment

There are a number of ways that your program might be deployed onto a SHARCNET cluster: pre-installed software, as a RPM file, as a JAR file, or from source. Supported software, found [here], has an staff member assigned to support it and does not require deployment. An RPM package, typically available with a complete software platform, will have the steps prepared and typically involve more than just the Java environment. The remainder of this article will deal with the last two options, installing from java ARchive (JAR) files or directly from source.

JAR files

A JAR file may be an "executable JAR file" which allow you to execute the program directly from the JAR file.

Compilation

Executing

Trouble Shooting

Error Message: Unsupported major.minor version 52.0
Cause: You are attempting to execute a java program on a different version JRE than it was compiled on. Often seen when running a Java 8 program on SHARCNET which is set up with Java 7.
Fix: Install the Java 8 (or appropriate version) in your home directory. To install Java 8, perform the following steps.

(1) Download the Java8 64 bit JRE tar file from oracle (jre-8u25-linux-x64.tar.gz).
(2) If you have not previoulsy done so, create a package sub-directory in your home directory (mkdir ~/package).
(3) Copy the tar file into this directory, and extract it using the following command 'tar zxvf ~/package/jre-8u25-linux-x64.tar.gz -C ~/package/'
(4) Add the following to the end of your ~/.bashrc file 'set PATH=~/home/package/jre1.8.0_25/bin:$PATH'
(5) Verify the installation by logging into a development node and executing the following line 'java -version', you should see.

java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)