Difference between revisions of "Applications/Java"
From HPC
(Created page with "__TOC__ ==Application Details== * Description: Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented,[14] and specifically...") |
(→Application Details) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
==Application Details== | ==Application Details== | ||
− | * Description: Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented,[14] and specifically designed to have as few implementation dependencies as possible. | + | * Description: Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented,[14] and specifically designed to have as few implementation dependencies as possible. Only OpenJDK versions are available. |
* Version: 6.5.14, 7.5.18 and 8.0.61 | * Version: 6.5.14, 7.5.18 and 8.0.61 | ||
− | * Modules: java/jdk1.7.0_80 and java/jdk1.8.0_102 | + | * Modules: openjdk/1.8.0_222-b10/gcc-8.2.0, openjdk/11.0.2/gcc-8.2.0, openjdk/openjdk-17.0.0_35 |
− | * Licence: Free, but owned by Oracle | + | * Legacy Modules: java/jdk1.7.0_80 and java/jdk1.8.0_102 redirect to openjdk/1.8.0_222-b10/gcc-8.2.0 |
+ | * Licence: Free, but owned by Oracle. Only OpenJDK versions are available and free and open source. | ||
==Usage Examples== | ==Usage Examples== | ||
{| | {| | ||
− | |style="width:5%; border-width: 0" | [[File: | + | |style="width:5%; border-width: 0" | [[File:Icon_exclam3.png]] |
|style="width:95%; border-width: 0" | Because Java is byte compiled and then run by a runtime program it requires the module to be loaded as well in a SLURM script. This is not the case with a standalone compiled program like from C/C++/Fortran source. | |style="width:95%; border-width: 0" | Because Java is byte compiled and then run by a runtime program it requires the module to be loaded as well in a SLURM script. This is not the case with a standalone compiled program like from C/C++/Fortran source. | ||
|- | |- | ||
Line 21: | Line 22: | ||
<pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | <pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | ||
− | [username@gpu01 ~]$ module | + | [username@gpu01 ~]$ module add java/jdk/1.8.0_102 |
[username@gpu01 ~]$ java myJAVA.javac | [username@gpu01 ~]$ java myJAVA.javac | ||
</pre> | </pre> | ||
− | === | + | ===Batch Job=== |
This is running the job through the scheduler '''SLURM''' by using the command ''sbatch myJOB.job'' | This is running the job through the scheduler '''SLURM''' by using the command ''sbatch myJOB.job'' | ||
− | <pre style=" | + | <pre style="font-family: monospace, sans-serif;"> |
#!/bin/bash | #!/bin/bash | ||
Line 53: | Line 54: | ||
</pre> | </pre> | ||
− | |||
==Further Information== | ==Further Information== | ||
Line 60: | Line 60: | ||
* [https://www.java.com/en/ https://www.java.com/en/] | * [https://www.java.com/en/ https://www.java.com/en/] | ||
− | + | {{Modulepagenav}} | |
− | { | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 20:35, 20 September 2024
Contents
Application Details
- Description: Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented,[14] and specifically designed to have as few implementation dependencies as possible. Only OpenJDK versions are available.
- Version: 6.5.14, 7.5.18 and 8.0.61
- Modules: openjdk/1.8.0_222-b10/gcc-8.2.0, openjdk/11.0.2/gcc-8.2.0, openjdk/openjdk-17.0.0_35
- Legacy Modules: java/jdk1.7.0_80 and java/jdk1.8.0_102 redirect to openjdk/1.8.0_222-b10/gcc-8.2.0
- Licence: Free, but owned by Oracle. Only OpenJDK versions are available and free and open source.
Usage Examples
Interactive Session
Note: this example is done on a compute node, usually access would be achieved with the scheduler
[username@gpu01 ~]$ module add java/jdk/1.8.0_102 [username@gpu01 ~]$ java myJAVA.javac
Batch Job
This is running the job through the scheduler SLURM by using the command sbatch myJOB.job
#!/bin/bash #SBATCH -J openJava-single-node #SBATCH -N 1 #SBATCH --ntasks-per-node 1 #SBATCH -o %N.%j.%a.out #SBATCH -e %N.%j.%a.err #SBATCH -p compute #SBATCH --exclusive echo $SLURM_JOB_NODELIST module purge module add java/jdk1.8.0_102 export I_MPI_DEBUG=5 export I_MPI_FABRICS=shm:tmi export I_MPI_FALLBACK=no java /home/user/CODE_SAMPLES/demoJAVA