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 In Modules, how do I save my environment with a .modules file?

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?

Back to top

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 various UITS Research Technologies units. For help, see Research computing support at IU.

Back to top

This is document bdnn in the Knowledge Base.
Last modified on 2017-07-11 17:15:33.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.