{"id":1090,"date":"2013-10-08T11:31:44","date_gmt":"2013-10-08T11:31:44","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/?page_id=1090"},"modified":"2016-07-12T14:11:51","modified_gmt":"2016-07-12T14:11:51","slug":"javac","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/software\/applications\/javac\/","title":{"rendered":"javac"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>The Java compiler <code>javac<\/code> is installed on the CSF but should <strong>not<\/strong> be used on the login node. <\/p>\n<p>Version 1.6.0 of the OpenJDK is installed on the CSF.<\/p>\n<h2>Restrictions on use<\/h2>\n<p>None.<\/p>\n<h2>Set up procedure<\/h2>\n<p>No modulefile is required &#8211; the software is installed system wide and available by default.<\/p>\n<h2>Running the application<\/h2>\n<p>As a quick test, create a file named <code>HelloWorld.java<\/code> using a text editor on the CSF (e.g. using <code>gedit<\/code>) which contains the following:<\/p>\n<pre>\r\npublic class HelloWorld {\r\n    public static void main(String[] args) {\r\n        System.out.println(\"Hello World\");\r\n    }\r\n}\r\n<\/pre>\n<p>Then compile the code using:<\/p>\n<pre>\r\njavac HelloWorld.java\r\n<\/pre>\n<p>Now run the code using:<\/p>\n<pre>\r\njava HelloWorld\r\n\r\n# It should print:\r\nHello World\r\n<\/pre>\n<p>Due to recent excessive memory usage on the login node, all processes running on that node are now restricted in their memory usage. The <code>javac<\/code> compiler will <strong>not<\/strong> execute on the login node, reporting a memory limit error:<\/p>\n<pre>\r\nError occurred during initialization of VM\r\nCould not reserve enough space for object heap\r\nCould not create the Java virtual machine.\r\n<\/pre>\n<p>You should start an interactive session using <a href=\"\/csf2\/csf-user-documentation\/sge-interactive-jobs-qrsh\/\">qrsh<\/a> to launch a shell on a backend node that has more memory. You can then run javac as normal.<\/p>\n<h3>Interactive Usage<\/h3>\n<p>Request an interactive session using:<\/p>\n<pre>\r\nqrsh -l inter -l short\r\n  #\r\n  # Wait for a new prompt to appear (e.g., <code>[<em>username@int00<\/em>]<\/code>)\r\n  #\r\njavac ...\r\n<\/pre>\n<h3>Running Compiled Java Code<\/h3>\n<p>Please read the <a href=\"\/csf-apps\/software\/applications\/java\">Java application launcher<\/a> notes for how to run java code in the batch system with the correct number of threads.<\/p>\n<h2>Updates<\/h2>\n<p>None.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211; 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.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/software\/applications\/javac\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":31,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1090","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/1090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/comments?post=1090"}],"version-history":[{"count":8,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/1090\/revisions"}],"predecessor-version":[{"id":3206,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/1090\/revisions\/3206"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/pages\/31"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf-apps\/wp-json\/wp\/v2\/media?parent=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}