Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| software:java:mills [2018-08-10 17:22] – anita | software:java:mills [2021-04-27 16:21] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Projects in Java on Mills ====== | ||
| + | |||
| + | Below is a basic Java example and steps you can follow and apply to your '' | ||
| + | |||
| + | <file java HelloWorld.java> | ||
| + | public class HelloWorld | ||
| + | { | ||
| + | public static void main(String[] args) | ||
| + | { | ||
| + | System.out.println(" | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | <note important> | ||
| + | |||
| + | Check the versions of java development available on your cluster by using | ||
| + | |||
| + | < | ||
| + | $ vpkg_versions openjdk | ||
| + | </ | ||
| + | |||
| + | and make sure you select the appropriate version to compile and create the '' | ||
| + | |||
| + | < | ||
| + | [mills ~]$ workgroup -g it_css | ||
| + | [(it_css: | ||
| + | [(it_css: | ||
| + | public class HelloWorld | ||
| + | { | ||
| + | public static void main(String[] args) | ||
| + | { | ||
| + | System.out.println(" | ||
| + | } | ||
| + | } | ||
| + | [(it_css: | ||
| + | Your job 2880210 (" | ||
| + | waiting for interactive job to be scheduled ... | ||
| + | Your interactive job 2880210 has been successfully scheduled. | ||
| + | Establishing / | ||
| + | Last login: Thu Apr 19 19:36:05 2018 from mills.mills.hpc.udel.edu | ||
| + | |||
| + | [(it_css: | ||
| + | Adding dependency `x11/ | ||
| + | Adding package `openjdk/ | ||
| + | [(it_css: | ||
| + | [(it_css: | ||
| + | HelloWorld.class | ||
| + | [(it_css: | ||
| + | Hello, World! | ||
| + | [(it_css: | ||
| + | [(it_css: | ||
| + | </ | ||
| + | |||
| + | Once we are back on the head node, you will need a job submission script to run your java job. For this simple example, copy '' | ||
| + | |||
| + | <file bash submit.qs> | ||
| + | # | ||
| + | # Template: | ||
| + | # Revision: | ||
| + | # | ||
| + | # If you want an email message to be sent to you when your job ultimately | ||
| + | # finishes, edit the -M line to have your email address and change the | ||
| + | # next two lines to start with #$ instead of just # | ||
| + | # -m eas | ||
| + | # -M my_address@mail.server.com | ||
| + | # | ||
| + | |||
| + | # Append all of your shell commands necessary to run your program | ||
| + | # after this line: | ||
| + | vpkg_require openjdk/ | ||
| + | java HelloWorld | ||
| + | </ | ||
| + | |||
| + | Now submit the job using '' | ||
| + | |||
| + | < | ||
| + | (it_css: | ||
| + | Your job 1392329 (" | ||
| + | [(it_css: | ||
| + | job-ID | ||
| + | ------------------------------------------------------------------------------------------------------------------------------------------------ | ||
| + | | ||
| + | [(it_css: | ||
| + | HelloWorld.class | ||
| + | [(it_css: | ||
| + | [(it_css: | ||
| + | Adding dependency `x11/ | ||
| + | Adding package `openjdk/ | ||
| + | Hello, World! | ||
| + | [(it_css: | ||
| + | </ | ||
| + | |||
| + | <note tip> | ||