Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
software:java:java [2018-01-05 10:37] – anita | software:java:java [2021-02-24 16:36] (current) – [Details by clusters] anita | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Projects in Java ====== | ====== Projects in Java ====== | ||
- | Below is a basic Java example | + | Using a basic Java example |
- | <file HelloWorld.java> | + | < |
public class HelloWorld | public class HelloWorld | ||
{ | { | ||
Line 13: | Line 13: | ||
</ | </ | ||
- | <note important> | + | ===== Details |
- | + | | |
- | On Farber and Mills, check the versions of java development by using | + | |
- | + | | |
- | < | + | |
- | $ vpkg_versions openjdk | + | |
- | </ | + | |
- | + | ||
- | To compile and create the '' | + | |
- | + | ||
- | < | + | |
- | [farber ~]$ workgroup -g it_css | + | |
- | [(it_css: | + | |
- | [(it_css: | + | |
- | public class HelloWorld | + | |
- | { | + | |
- | | + | |
- | { | + | |
- | System.out.println(" | + | |
- | } | + | |
- | } | + | |
- | [(it_css:traine)@farber | + | |
- | Your job 1392265 (" | + | |
- | waiting for interactive job to be scheduled ... | + | |
- | Your interactive job 1392265 has been successfully scheduled. | + | |
- | Establishing / | + | |
- | [(it_css:traine)@n040 java]$ vpkg_devrequire openjdk/ | + | |
- | Adding package `openjdk/ | + | |
- | [(it_css: | + | |
- | [(it_css: | + | |
- | HelloWorld.class | + | |
- | [(it_css: | + | |
- | Hello, World! | + | |
- | [(it_css:traine)@n040 | + | |
- | [(it_css:traine)@farber | + | |
- | </ | + | |
- | + | ||
- | Back on the head node, you need a submission script to run your java job. For this simple example, we will use a copy of '' | + | |
- | + | ||
- | <file submit.qs> | + | |
- | # | + | |
- | # Template: | + | |
- | # | + | |
- | # Change the following to #$ and set the amount of memory you need | + | |
- | # per-slot if you're getting out-of-memory errors using the | + | |
- | # default: | + | |
- | # -l m_mem_free=2G | + | |
- | # | + | |
- | # 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 | + | |
- | # | + | |
- | + | ||
- | # Add vpkg_require commands after this line: | + | |
- | vpkg_require openjdk/ | + | |
- | + | ||
- | # Now append all of your shell commands necessary to run your program | + | |
- | # after this line: | + | |
- | java HelloWorld | + | |
- | </ | + | |
- | + | ||
- | Now we can run our job using '' | + | |
- | + | ||
- | < | + | |
- | (it_css: | + | |
- | Your job 1392329 (" | + | |
- | [(it_css: | + | |
- | job-ID | + | |
- | ------------------------------------------------------------------------------------------------------------------------------------------------ | + | |
- | | + | |
- | [(it_css: | + | |
- | HelloWorld.class | + | |
- | [(it_css:traine)@farber | + | |
- | [(it_css:traine)@farber java]$ cat submit.qs.o1392329 | + | |
- | + | ||
- | [CGROUPS] UD Grid Engine cgroup setup commencing | + | |
- | [CGROUPS] Setting 1073741824 bytes (vmem none bytes) on n038 (master) | + | |
- | [CGROUPS] | + | |
- | [CGROUPS] done. | + | |
- | + | ||
- | Adding package `openjdk/ | + | |
- | Hello, World! | + | |
- | [(it_css: | + | |
- | </ | + | |
- | + | ||
- | Please review the templates for job submission scripts in ''/ | + |