Jun 4, 2013

Run Android Java console program

$ cat Hello.java
class Hello {
        public static void main(String[] args) {
                System.out.println("Hello World!");
        }
}

$ javac Hello.java

$ dx --version
dx version 1.7

$ dx --dex --output=Hello.dex Hello.class

$ ls
Hello.class  Hello.dex  Hello.java

$ adb push Hello.dex /data/local/tmp/

4.0 User:
$ adb shell dalvikvm -cp /data/local/tmp/Hello.dex Hello
Dalvik VM unable to locate class 'Hello'
java.lang.NoClassDefFoundError: Hello
        at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Hello
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
        ... 1 more

4.0 Eng:
$ adb shell dalvikvm -cp /data/local/tmp/Hello.dex Hello

Hello World!

6 comments:

  1. Attributes of Getting a Divorce Attorney Hiring a highly highly regarded, community, seasoned, trustworthy attorney for the divorce may have several advantages. When you hire a divorce lawyer, you get a great suggest as well as friend over the means of divorce. A divorce attorney will even understand the legal aspects and alternatives you could have possess during the divorce. An attorney can advise as well as stand for the customer they've legal protection under the law to.
    divorce lawyers
    Both parties generally require a clean bust plus a opportunity to move on from the damage as well as anger. A great attorney help keep the situation expert and help manage crucial issues such as custody plans, resources and also credit card debt duties. The particular divorce attorney usually takes attention crucial paper-work and may accomplish their best to get the customer a good struggle. If you are on a limited spending budget, you could still obtain an effective attorney.

    ReplyDelete
  2. http://www.springboardsquare.com/blogs/post/140434
    http://www.charityorb.com/groups/1088
    http://sexbook.pw/groups/14
    http://shirt-tube.de/community/event/12127
    http://www.google-search-engine.com/optimize/blogs/post/49769
    http://www.leadnetwork.me/blogs/post/2979#sthash.Lmk9EkP6.nqPAi0se.dpbs
    http://runwox.com/blogs/post/16950
    http://brawijayaadigraha.com/oxwall/groups/519
    http://mts-assalaam.sch.id/forum/groups/587
    http://fleximarriage.com/groups/7769

    ReplyDelete
  3. http://igniss.com/fr/bollywood-anushka-sharma
    http://ikebana-turkiye.com/?option=com_k2&view=itemlist&task=user&id=89844
    http://ilic-immobilien.de/?option=com_k2&view=itemlist&task=user&id=50888
    http://im-studio.eu/?option=com_k2&view=itemlist&task=user&id=36039
    http://image-wrzesnia.pl/?option=com_k2&view=itemlist&task=user&id=355
    http://imct.aimct.com/?document_srl=791481
    http://imotski-svitnjak.com/?option=com_k2&view=itemlist&task=user&id=212684
    http://importadorarepare.com/?option=com_k2&view=itemlist&task=user&id=146820
    http://inclub.lg.ua/?option=com_k2&view=itemlist&task=user&id=1058460
    http://infolog.mr/mr-infolog/?option=com_k2&view=itemlist&task=user&id=823915

    ReplyDelete
  4. http://startupf.net/index.php/blog/13926/bollywood-kajol-images/
    http://steag.in/content/kajol-photo
    http://stg-qbs-qbs.cgstack.com/content/kajol-marriage-photos-images
    http://stille-in-freiburg.de/node/332
    http://stock-day-trader.info/blogs/viewstory/89305
    http://stock-market-newsletters.info/blogs/viewstory/361809
    http://stockoptionspick.org/blogs/viewstory/309866
    http://stockoptionspicks.net/blogs/viewstory/205514
    http://strammer.com/?option=com_k2&view=itemlist&task=user&id=1058839
    http://strandnixxen.de/index.php/component/k2/itemlist/user/537

    ReplyDelete
  5. http://roextrade.com/?option=com_k2&view=itemlist&task=user&id=117591
    http://romanzavillas.gr/index.php/el/component/k2/itemlist/user/115785
    http://rpstal.pl/?option=com_k2&view=itemlist&task=user&id=95495
    http://rsiacempakaputih.com/index.php/component/k2/itemlist/user/192617
    http://rtstrasporti.com/index.php/component/k2/author/84477
    http://rudraautomation.com/index.php/component/k2/author/107548
    http://ruouvangparadise.com/index.php/component/k2/itemlist/user/18840
    http://s2.kasimov.biz/?option=com_k2&view=itemlist&task=user&id=277335
    http://s599817635.online.de/index.php/component/k2/itemlist/user/35032
    http://safedhall.com/?option=com_k2&view=itemlist&task=user&id=181332

    ReplyDelete
  6. http://good-beton.com/component/k2/itemlist/user/37827
    http://gozetimymm.org/?option=com_k2&view=itemlist&task=user&id=446581
    http://gpipublicidad.com/?option=com_k2&view=itemlist&task=user&id=101426
    http://greenest.ir/?option=com_k2&view=itemlist&task=user&id=85434
    http://greenpower.ug/?option=com_k2&view=itemlist&task=user&id=477177
    http://grupoeucalis.com.ar/?option=com_k2&view=itemlist&task=user&id=303
    http://gsv-tu-darmstadt.de/index.php/component/k2/itemlist/user/130760
    http://guillermohernandez.es/index.php/component/k2/itemlist/user/223608
    http://gulf-ceramic.com/?option=com_k2&view=itemlist&task=user&id=74184
    http://gumiavtomobilni.com/index.php/en/component/k2/itemlist/user/113803

    ReplyDelete

您的评论将使我blog更有动力~