The CSF2 has been replaced by the CSF3 - please use that system! This documentation may be out of date. Please read the CSF3 documentation instead. To display this old CSF2 page click here. |
javac
Overview
The Java compiler javac
is installed on the CSF but should not be used on the login node.
Version 1.6.0 of the OpenJDK is installed on the CSF.
Restrictions on use
None.
Set up procedure
No modulefile is required – the software is installed system wide and available by default.
Running the application
As a quick test, create a file named HelloWorld.java
using a text editor on the CSF (e.g. using gedit
) which contains the following:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } }
Then compile the code using:
javac HelloWorld.java
Now run the code using:
java HelloWorld # It should print: Hello World
Due to recent excessive memory usage on the login node, all processes running on that node are now restricted in their memory usage. The javac
compiler will not execute on the login node, reporting a memory limit error:
Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.
You should start an interactive session using qrsh to launch a shell on a backend node that has more memory. You can then run javac as normal.
Interactive Usage
Request an interactive session using:
qrsh -l inter -l short
#
# Wait for a new prompt to appear (e.g., [username@int00]
)
#
javac ...
Running Compiled Java Code
Please read the Java application launcher notes for how to run java code in the batch system with the correct number of threads.
Updates
None.