Compiling Java programs on Big Red II at IU

On this page:


Adding the Java compiler to your user environment

The Java programming language compiler (javac) is available on Big Red II at Indiana University.

To add it to your Big Red II user environment, load the java module; on the command line, enter:

  module load java

To make permanent changes to your environment, edit your ~/.modules file. For more, see Use a .modules file in your home directory to save your user environment on an IU research supercomputer.

For more about using Modules to configure your user environment, see On the research computing systems at IU, how do I use Modules to manage my software environment?

Example

To compile a Java program (e.g., simple.java), on the command line, enter:

  javac simple.java

If the program compiles correctly, a bytecode class file (e.g., simple.class) is created. To run the program, use the java command:

  java simple

Options

The javac compiler has its own unique set of standard options, and does not support optimizations or threads.

For a summary of options for the javac compiler, see the javac manual file on Big Red II; on the command line, enter:

  man javac

Running Java code

Java code compiled with the current Java module (java/jdk1.7.0_07) will run only in Big Red II's Cluster Compatibility Mode (CCM) execution environment. Before submitting a batch job, make sure you've added the ccm module to your ~/.modules file and prepared a TORQUE job script that will launch your application in the CCM execution environment. For instructions, see How do I run batch jobs on Big Red II at IU?

Getting help

Support for IU research computing systems, software, and services is provided by the Research Technologies division of UITS. To ask a question or get help, contact UITS Research Technologies.

This is document bdnn in the Knowledge Base.
Last modified on 2017-11-17 13:32:51.

Contact us

For help or to comment, email the UITS Support Center.