{"id":76,"date":"2008-06-09T12:53:17","date_gmt":"2008-06-09T10:53:17","guid":{"rendered":"http:\/\/java4iphone.com\/all-news\/tutorial-compile-and-run-java-application-on-the-iphone\/"},"modified":"2008-06-09T12:53:17","modified_gmt":"2008-06-09T10:53:17","slug":"tutorial-compile-and-run-java-application-on-the-iphone","status":"publish","type":"post","link":"https:\/\/jailbreak-iphone.ru\/en\/tutorial-compile-and-run-java-application-on-the-iphone\/","title":{"rendered":"Tutorial: compile and run Java application on the IPhone"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_4.jpg\" alt=\"Run\" \/><\/p>\n<p>This is a <a href=\"https:\/\/jailbreak-iphone.ru\/en\/category\/all\/tutorial\/\" target=\"_blank\" class=\"slink\" title=\"tutorial\" >tutorial<\/a>, that shows step by step how to use installed Java on the IPhone. Just in case you do not have Java installed on your IPhone there is a <noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/tutorial-install-java-on-the-iphone\/\"  target=\"_blank\">tutorial<\/a><\/noindex> how to do it.<\/p>\n<p>What we need is a working <noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/iphone.unlock.no\/\" target=\"_blank\"  target=\"_blank\">jailbraked<\/a><\/noindex> IPhone with <noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/tutorial-install-java-on-the-iphone\/\" target=\"_blank\"  target=\"_blank\">Java Installed<\/a><\/noindex>. I used latest <a href=\"https:\/\/jailbreak-iphone.ru\/en\/category\/all\/software\/firmware\/\" class=\"slink\" title=\"firmware\" >firmware<\/a> 1.1.4, unlocked, jailbreaked and customized by <noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/winpwn.com\/\" target=\"_blank\"  target=\"_blank\">winpwn<\/a><\/noindex>.<\/p>\n<p>Step 1: Create simple Java <a href=\"https:\/\/jailbreak-iphone.ru\/en\/tag\/application\/\" target=\"_blank\" class=\"slink\" title=\"application\" >application<\/a>, compile and run.<\/p>\n<p><!--more--><\/p>\n<ol>\n<li>Create file Java4IPhone.java and put simple Java hello-world code there. I used the following code:<noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_0.jpg\" title=\"Create Java hello-world\" ><img decoding=\"async\" src=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_0_sm.jpg\" alt=\"Create Java hello-world\" \/><\/a><\/noindex><\/li>\n<li>Upload to IPhone. I used \/tmp directory. For uploading I used <noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/code.google.com\/p\/iphonebrowser\/\" target=\"_blank\"  target=\"_blank\">IPhone Browser<\/a><\/noindex>.<\/li>\n<li>Run Terminal.<\/li>\n<li>Use command <em>java -fullversion<\/em> or <em>jamvm -fullversion<\/em> to see if java is avaliable.<\/li>\n<li>Use command <em>jikes <\/em>to invoke java compiler.<\/li>\n<li>Go to \/tmp directory, using command <em> <\/em><em>cd \/tmp<\/em><\/li>\n<li>Compile. We need to specify classpath to basic java packages. If we do not do that, jikes will produce an error (see screenshot). So use the following command:<em> <\/em><em>jikes Java4IPhone.java -cp \/usr\/lib\/rt.jar<\/em><\/li>\n<li>After compiling <em>Java4IPhone.class <\/em>file should appear in the same directory. To run use command<em>java Java4IPhone<\/em><\/li>\n<li>Take a look at the <a href=\"https:\/\/jailbreak-iphone.ru\/en\/tag\/screenshots\/\" target=\"_blank\" class=\"slink\" title=\"screenshots\" >screenshots<\/a>. Hopefully you&#8217;ll have something similar.<\/li>\n<\/ol>\n<p><noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_01.jpg\" title=\"Upload Java application to IPhone\" ><img decoding=\"async\" src=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_01_sm.jpg\" alt=\"Upload Java application to IPhone\" \/><\/a><\/noindex><\/p>\n<p><noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_1.jpg\" title=\"Check Java and Jikes\" ><img decoding=\"async\" src=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_1_sm.jpg\" alt=\"Check Java and Jikes\" \/><\/a><\/noindex> <noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_3.jpg\" title=\"Compile using Jikes\" ><img decoding=\"async\" src=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_3_sm.jpg\" alt=\"Compile using Jikes\" \/><\/a><\/noindex> <noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_4.jpg\" title=\"Run\" ><img decoding=\"async\" src=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_4_sm.jpg\" alt=\"Run\" \/><\/a><\/noindex><\/p>\n<p><noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_5.jpg\" title=\"step3_5_sm.jpg\" > <\/a><\/noindex><\/p>\n<p><noindex><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_5.jpg\" title=\"Upload Java application to IPhone\" ><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jailbreak-iphone.ru\/wp-content\/uploads\/2008\/06\/step3_5_sm.jpg\" alt=\"Upload Java application to IPhone\" width=\"280\" height=\"156\" \/><\/a><\/noindex><\/p>\n<p>Step 2: Have fun!<!-- wp_post_end --><!-- TEST --><\/p>","protected":false},"excerpt":{"rendered":"<p>This is a tutorial, that shows step by step how to use installed Java on the IPhone. Just in case you do not have Java installed on your IPhone there is a tutorial how to do it. What we need is a working jailbraked IPhone with Java Installed. I used latest firmware 1.1.4, unlocked, jailbreaked [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5,468,10,11],"tags":[818,901,903,1213,906,1161,542,1415,546,135,162,187,188,1408,942,277,1183,283,302,1410,1411,330,1070,1101],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category-all","category-java","category-java-applications","category-software","category-tutorial","tag-a4","tag-ads","tag-app","tag-application","tag-browser","tag-ed","tag-error","tag-firmware","tag-fun","tag-google","tag-iphone","tag-jailbreak","tag-jamvm","tag-java","tag-screenshot","tag-screenshots","tag-sed","tag-sim","tag-test","tag-tutorial","tag-unlock","tag-winpwn","tag-1070","tag-1101"],"_links":{"self":[{"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":0,"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jailbreak-iphone.ru\/en\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}