JAVA Environment

JAVA is a high-level object-oriented programming language that is designed to minimize implementation dependencies. It is a class-based general-purpose programming language that can be run anywhere. Compiled Java code can run on all platforms that support Java. There is no need to recompile the Java code for different platforms.

Java is available on all Login and Compute nodes in the Arc HPC Environment. It is installed locally on each node.

The following Environment variables for Java are defined by default with each users Bash shell:

export JAVA_HOME=$( j=$( readlink -f /usr/bin/javac ) ; echo ${j%%/bin/javac} )
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$( j=$( readlink -f /bin/javac ); echo ${j/%bin\/javac/jre\/lib\/amd64\/server} )
export JAVA_TOOL_OPTIONS="-Xms2G -Xmx2G"

As of the date of this article, the values for JAVA_HOME and the additional LD_LIBRARY_PATH are currently:

JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/lib/amd64/server

View the current JAVA_HOME and LD_LIBRARY_PATH variables with the "echo" command in your shell to verify their current values.

The JAVA_HOME environment variable points to the directory where the Java Development Kit (JDK) is installed. The Java Runtime Environment (JRE) is included as a subdirectory in the JDK directory.

LD_LIBRARY_PATH is the default library path which is accessed to check for available dynamic and shared libraries.

JAVA_TOOL_OPTIONS sets the initial and maximum Java heap size to 2 GB.

To view other java parameters, issue the command:

[login001: abc123]# java -X
    -Xmixed           mixed mode execution (default)
    -Xint             interpreted mode execution only
    -Xbootclasspath:<directories and zip/jar files separated by :>
                      set search path for bootstrap classes and resources
    -Xbootclasspath/a:<directories and zip/jar files separated by :>
                      append to end of bootstrap class path
...

Note that these variables may need to be adjusted depending on your application requirements.

This topic: ARC > WebTopicList > JavaEnvironment
Topic revision: 16 Aug 2021, AdminUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback