Welcome to the iFans Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!

How to Install Java VM on your iPod Touch

Discussion in 'iOS Jailbreak & Cydia' started by ali.bigolo, Nov 29, 2007.

Thread Status:
Not open for further replies.
  1. ali.bigolo

    ali.bigolo Member

    Joined:
    Oct 11, 2007
    Messages:
    347
    Likes Received:
    6
    Device:
    iPhone 3G (Black)
    This couldn't be more straight forward but so many people are asking for a "Guide" that I decided to make a quick one here.

    NOTE: This will not allow your browser to view any java based content (play java games online or...) this is merely a terminal based java VM which allows you to run Already compiled java files on your iPod; in other words you will need to transfer your ".class" files into your ipod and the run them..

    1. To get on your way first you'll need to add a new repository to your installer's "Sources":
    1.1. Open installer and go to "Sources" on the buttom far right of the screen
    1.2. Tap "Edit" on the top right corner and then "Add"
    snap_013845.jpg
    1.3. Once the "Add source" pop up window appears type "http://iphone.saurik.com/" in the text field and tap OK​

    2. Install the VM and the ClassPath
    2.1. Go to "Install" and scroll down to the "Java" category
    snap_013932.jpg
    2.2. Once there download GNU Classpath first and then the JavaVM​

    This section of the guide walks you through a very basic java application that will enable you to print out a message to the screen

    3. Download a java SDK from here and update you Environment variables to include the path to your java "bin" folder (I assume you are able to search the internet on how to do this if not ask here and I'll update the guide)
    4. Open a text editor of your choice and copy the following code over replacing MSG with a message of your own and save the file as "msg.java":

    public class msg {
    public static void main(String[] args) {
    System.out.println("MSG");

    }
    }
    5. Open a command prompt window (by going to Start --> Run and typing CMD) navigate to where your file is saved and type "javac msg.java"
    6. you will notice that a msg.class is created in your working folder copy that to a folder on your ipod

    This section concerns the running of the compiled java files

    7. Open a terminal on your ipod Term-vt100 is downloadable via the Installer
    8. navigate to where your .class file is stored and type "java msg"
    9. You will have your message displayed on the screen


    This guide is aimed at a variety of users with different level of experties and undrestanding of computer procedures and Java, it only aimes to give a taste of what you can do with this "new" javaVM. Post any questions you may have about java and what you can do with it and I'll try to answer them.

    Also post any ideas you may have about usefull Java applications.

    Ali
  2. tag009

    tag009 Member

    Joined:
    Sep 27, 2007
    Messages:
    797
    Likes Received:
    7
    Device:
    iPhone 4 (Black)
    ok when I install gnu classpath or whatever in installer it downloads all the way and then starts to install but quits. Also what else would this be capable of doing?
  3. rossiposse

    rossiposse New Member

    Joined:
    Sep 24, 2007
    Messages:
    75
    Likes Received:
    0
    Device:
    iPhone 3G (White)
    this happens to me also... in installing packages part the installer crashes

    edit:
    the reason why I can't download this is because of too much app
  4. Mint-Berry Crunch

    Mint-Berry Crunch Member

    Joined:
    Sep 19, 2007
    Messages:
    781
    Likes Received:
    7
    Device:
    iPad 3
    Works fine to me! Where do I put extentions (jar files) for my import lines?
  5. gamer4eva

    gamer4eva Member

    Joined:
    Oct 14, 2007
    Messages:
    130
    Likes Received:
    0
    Device:
    iPhone 4 (Black)
    Just out of curiosity, is it possible to create applications for the iPod touch in the java language now?


    ~gamer4eva
  6. will1018

    will1018 New Member

    Joined:
    Oct 20, 2007
    Messages:
    59
    Likes Received:
    0
    do i have to do steps 3 and on or r those for something else
  7. Mint-Berry Crunch

    Mint-Berry Crunch Member

    Joined:
    Sep 19, 2007
    Messages:
    781
    Likes Received:
    7
    Device:
    iPad 3
    i never did step 3. i did make a basic program and tested it though
  8. kinematic@yahoo.com

    kinematic@yahoo.com New Member

    Joined:
    Oct 14, 2007
    Messages:
    172
    Likes Received:
    0
    ;) Hahaha nice tutorial!

    And to everyone else... this is pretty much all it can do for now. There is no graphic support at this stage:

    Read this link to see where they are:
    http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java

    They sound relatively close, but if there are any UIKit experts out there, then your help on the project will speed up the development into making this into a practical mod.

    If we have the same kind of effort in the gpSPhone then certainly those who want more Java support in Safari will get their wish.
  9. ali.bigolo

    ali.bigolo Member

    Joined:
    Oct 11, 2007
    Messages:
    347
    Likes Received:
    6
    Device:
    iPhone 3G (Black)
    This is what you need to do:

    http://www.ifans.com/forums/showthread.php?t=8692
  10. ali.bigolo

    ali.bigolo Member

    Joined:
    Oct 11, 2007
    Messages:
    347
    Likes Received:
    6
    Device:
    iPhone 3G (Black)
    If you want to run jar files then download "GNU Classpath Tools" from the installer and you can put the jar file anywhere you want really. Unless you mean something else by the question (within the java code?). Just remember it won't run any applications with a GUI, only command line.

    Ali
Thread Status:
Not open for further replies.

Share This Page