[iphone-java] How to compile HelloJava from Jay on my iPhone

Wesley Biggs wesley at cacas.org
Sun Aug 3 11:23:07 UTC 2008


At one point in the 1.1.x past I had ecj working to compile on iphone,
but it was dog slow.  I think all I did was grab the ecj.jar from an
Eclipse install and hook it up to a script called javac.  YMMV.

I definitely think you're better off compiling on the desktop for now, though.

Wes

2008/8/3 Jay Freeman (saurik) <saurik at saurik.com>:
> You can't compile JocStrap'd code on the iPhone as we don't have a 1.5
> compliant compiler there. You need to use another computer and transfer the
> resulting .class files over. -J
>
> --------------------------------------------------
> From: "ako74" <ako74 at vtxfree.ch>
> Sent: Sunday, August 03, 2008 2:37 AM
> To: <iphone-java at telesphoreo.org>
> Subject: [iphone-java] How to compile HelloJava from Jay on my iPhone
>
>> Hi there again,
>>
>> today i just started java-developing on my iphone.
>> when trying to compile my own first code, i ran into errors.
>> than i tried to compile Jay's HelloJava ... and ran into errors.
>>
>> i am missing something, please help me. :-)
>>
>> i use: iphone os2.0
>> Classpath-package 0.96.1-3
>> iPhone/Java-package 1.0.2474-2
>> JamVM-package 1.5.1b2-3
>> Java SQLite package 20080130-3
>> Jikes package 1.22-3
>> JocStrap package 1.0.2466-5
>> UICaboodle pckage 1.0.2475-2
>>
>> wanted to compile using jikes, just as described in:
>> http://java4iphone.com/all-news/tutorial-compile-and-run-java-application-on-the-iphone/
>>
>> so, when using the comand:
>>  root# jikes HelloJava.java -source 1.5 -cp /usr/share/java/
>> sqlite.jar:/usr/share/java/jocstrap.jar:/usr/share/java/
>> uicaboodle.jar:/usr/share/classpath/glibj.zip:/usr/share/jamvm/
>> classes.zip:/usr/share/classpath/tools.zip
>>
>> I got plenty of errors as added below.
>> what am i doing wrong???
>>
>> thank you in advance for your help. ´:-)
>>
>> regards ako
>>
>>
>> Issued 1 lexical warning in "HelloJava.java":
>>
>>     48. @Message int numberOfSectionsInSectionList$(UISectionList
>> list) {
>>                      ^----------------------------^
>> *** Lexical Warning: The use of "$" in an identifier, while legal, is
>> strongly discouraged, since it can conflict with compiler-generated
>> names. If you are trying to access a nested type, use "." instead of
>> "$".
>>
>> Found 52 semantic errors compiling "HelloJava.java":
>>
>>      4. import joc.Message;
>>                    ^-----^
>> *** Semantic Error: The class file "Message.class" in "/usr/share/java/
>> jocstrap.jar/joc" has an invalid format (bad type for annotation
>> component enum).
>>
>>
>>      6. import static joc.Pointer.*;
>>                ^----^
>> *** Semantic Error: Static imports are only supported for `-source
>> 1.5' or greater.(not yet implemented)
>>
>>
>>      7. import static joc.Static.*;
>>                ^----^
>> *** Semantic Error: Static imports are only supported for `-source
>> 1.5' or greater.(not yet implemented)
>>
>>
>>     13.     extends UIApplication
>>                     ^-----------^
>> *** Semantic Error: The class file "UIApplication.class" in "/usr/
>> share/java/jocstrap.jar/obc" has an invalid format (bad string
>> annotation constant).
>>
>>
>>     16. private UIWindow window;
>>                 ^------^
>> *** Semantic Error: The class file "UIWindow.class" in "/usr/share/
>> java/jocstrap.jar/obc" has an invalid format (bad string annotation
>> constant).
>>
>>
>>     45. private ArrayList<Contact> contacts_;
>>                          ^-------^
>> *** Semantic Error: Using type arguments to access generic types
>> requires the use of "-source 1.5" or greater. Compilation will
>> continue using the raw type "java.util.ArrayList", but no class file
>> will be emitted.(not yet implemented)
>>
>>
>>     46. private ArrayList<Section> sections_;
>>                          ^-------^
>> *** Semantic Error: Using type arguments to access generic types
>> requires the use of "-source 1.5" or greater. Compilation will
>> continue using the raw type "java.util.ArrayList", but no class file
>> will be emitted.(not yet implemented)
>>
>>
>>     48. @Message int numberOfSectionsInSectionList$(UISectionList
>> list) {
>>         ^------^
>> *** Semantic Error: Annotation modifiers are only supported for `-
>> source 1.5' or greater.(not yet implemented)
>>
>>
>>     48. @Message int numberOfSectionsInSectionList$(UISectionList
>> list) {
>>                                                     ^-----------^
>> *** Semantic Error: The class file "UISectionList.class" in "/usr/
>> share/java/jocstrap.jar/obc" has an invalid format (bad string
>> annotation constant).
>>
>>
>>     52. @Message String sectionList$titleForSection$(UISectionList
>> list, int section) {
>>         ^------^
>> *** Semantic Error: Annotation modifiers are only supported for `-
>> source 1.5' or greater.(not yet implemented)
>>
>>
>>     52. @Message String sectionList$titleForSection$(UISectionList
>> list, int section) {
>>                                                      ^-----------^
>> *** Semantic Error: Type "UISectionList" was not found.
>>
>>
>>     53.     return sections_.get(section).title;
>>                                           ^---^
>> *** Semantic Error: No accessible field named "title" was found in
>> type "java.lang.Object".
>>
>>
>>     56. @Message int sectionList$rowForSection$(UISectionList list,
>> int section) {
>>         ^------^
>> *** Semantic Error: Annotation modifiers are only supported for `-
>> source 1.5' or greater.(not yet implemented)
>>
>>
>>     56. @Message int sectionList$rowForSection$(UISectionList list,
>> int section) {
>>                                                 ^-----------^
>> *** Semantic Error: Type "UISectionList" was not found.
>>
>>
>>     57.     return sections_.get(section).row;
>>                                           ^-^
>> *** Semantic Error: No accessible field named "row" was found in type
>> "java.lang.Object".
>>
>>
>>     60. @Message int numberOfRowsInTable$(UITable table) {
>>         ^------^
>> *** Semantic Error: Annotation modifiers are only supported for `-
>> source 1.5' or greater.(not yet implemented)
>>
>>
>>     60. @Message int numberOfRowsInTable$(UITable table) {
>>                                           ^-----^
>> *** Semantic Error: The class file "UITable.class" in "/usr/share/java/
>> jocstrap.jar/obc" has an invalid format (bad string annotation
>> constant).
>>
>>
>>     64. @Message UITableCell table$cellForRow$column$reusing$(UITable
>> table, int row, UITableColumn col, UITableCell reusing) {
>>         ^------^
>> *** Semantic Error: Annotation modifiers are only supported for `-
>> source 1.5' or greater.(not yet implemented)
>>
>>
>>     64. @Message UITableCell table$cellForRow$column$reusing$(UITable
>> table, int row, UITableColumn col, UITableCell reusing) {
>>                  ^---------^
>> *** Semantic Error: The class file "UITableCell.class" in "/usr/share/
>> java/jocstrap.jar/obc" has an invalid format (bad string annotation
>> constant).
>>
>>
>>     64. @Message UITableCell table$cellForRow$column$reusing$(UITable
>> table, int row, UITableColumn col, UITableCell reusing) {
>>                                                               ^-----^
>> *** Semantic Error: Type "UITable" was not found.
>>
>>
>>     64. @Message UITableCell table$cellForRow$column$reusing$(UITable
>> table, int row, UITableColumn col, UITableCell reusing) {
>>
>> ^
>> -----------^
>> *** Semantic Error: The class file "UITableColumn.class" in "/usr/
>> share/java/jocstrap.jar/obc" has an invalid format (bad string
>> annotation constant).
>>
>>
>>     64. @Message UITableCell table$cellForRow$column$reusing$(UITable
>> table, int row, UITableColumn col, UITableCell reusing) {
>>
>> ^
>> ---------^
>> *** Semantic Error: Type "UITableCell" was not found.
>>
>>
>>     65.     Contact contact = contacts_.get(row);
>>                     ^--------------------------^
>> *** Semantic Error: The type of the right sub-expression,
>> "java.lang.Object", is not assignable to the variable, of type
>> "HelloJava$Contact".
>>
>>
>>     67.     UIImageAndTextTableCell cell;
>>             ^---------------------^
>> *** Semantic Error: The class file "UIImageAndTextTableCell.class" in
>> "/usr/share/java/jocstrap.jar/obc" has an invalid format (bad string
>> annotation constant).
>>
>>
>>     69.         cell = (UIImageAndTextTableCell) reusing;
>>                         ^---------------------^
>> *** Semantic Error: Type "UIImageAndTextTableCell" was not found.
>>
>>
>>     71.         cell = (UIImageAndTextTableCell) new
>> UIImageAndTextTableCell().init();
>>                         ^---------------------^
>> *** Semantic Error: Type "UIImageAndTextTableCell" was not found.
>>
>>
>>     71.         cell = (UIImageAndTextTableCell) new
>> UIImageAndTextTableCell().init();
>>
>> ^---------------------^
>> *** Semantic Error: Type "UIImageAndTextTableCell" was not found.
>>
>>
>>     77. @Message public byte table$canSelectRow$(UITable table, int
>> row) {
>>         ^------^
>> *** Semantic Error: Annotation modifiers are only supported for `-
>> source 1.5' or greater.(not yet implemented)
>>
>>
>>     77. @Message public byte table$canSelectRow$(UITable table, int
>> row) {
>>                                                  ^-----^
>> *** Semantic Error: Type "UITable" was not found.
>>
>>
>>     78.     return NO;
>>                    ^^
>> *** Semantic Error: No accessible field named "NO" was found in type
>> "HelloJava".
>>
>>
>>     81. @Message public void applicationDidFinishLaunching$(Object
>> unused)
>>         ^------^
>> *** Semantic Error: Annotation modifiers are only supported for `-
>> source 1.5' or greater.(not yet implemented)
>>
>>
>>     85.     contacts_ = new ArrayList<Contact>();
>>                                      ^-------^
>> *** Semantic Error: Using type arguments to access generic types
>> requires the use of "-source 1.5" or greater. Compilation will
>> continue using the raw type "java.util.ArrayList", but no class file
>> will be emitted.(not yet implemented)
>>
>>
>>     86.     sections_ = new ArrayList<Section>();
>>                                      ^-------^
>> *** Semantic Error: Using type arguments to access generic types
>> requires the use of "-source 1.5" or greater. Compilation will
>> continue using the raw type "java.util.ArrayList", but no class file
>> will be emitted.(not yet implemented)
>>
>>
>>     89.     ab.open(userHomeDirectory().toString() + "/Library/
>> AddressBook/AddressBook.sqlitedb", 0666); try {
>>                     ^-----------------^
>> *** Semantic Error: No accessible method with signature
>> "userHomeDirectory()" was found in type "HelloJava".
>>
>>
>>     99.     CGRect outer = UIHardware.
>> $fullScreenApplicationContentRect();
>>                            ^--------^
>> *** Semantic Error: The class file "UIHardware.class" in "/usr/share/
>> java/jocstrap.jar/obc" has an invalid format (bad string annotation
>> constant).
>>
>>
>>    100.     window = new UIWindow().initWithContentRect$(outer);
>>                          ^------^
>> *** Semantic Error: Type "UIWindow" was not found.
>>
>>
>>    104.     window._setHidden$(NO);
>>                                ^^
>> *** Semantic Error: No accessible field named "NO" was found in type
>> "HelloJava".
>>
>>
>>    107.     CGSize navsize = UINavigationBar.$defaultSize();
>>                              ^-------------^
>> *** Semantic Error: The class file "UINavigationBar.class" in "/usr/
>> share/java/jocstrap.jar/obc" has an invalid format (bad string
>> annotation constant).
>>
>>
>>    110.     UIView view = new UIView().initWithFrame$(inner);
>>             ^----^
>> *** Semantic Error: The class file "UIView.class" in "/usr/share/java/
>> jocstrap.jar/obc" has an invalid format (bad string annotation
>> constant).
>>
>>
>>    110.     UIView view = new UIView().initWithFrame$(inner);
>>                               ^----^
>> *** Semantic Error: Type "UIView" was not found.
>>
>>
>>    113.     UINavigationBar navbar = new
>> UINavigationBar().initWithFrame$(navrect);
>>             ^-------------^
>> *** Semantic Error: Type "UINavigationBar" was not found.
>>
>>
>>    113.     UINavigationBar navbar = new
>> UINavigationBar().initWithFrame$(navrect);
>>                                          ^-------------^
>> *** Semantic Error: Type "UINavigationBar" was not found.
>>
>>
>>    118.     UINavigationItem navitem = new
>> UINavigationItem().initWithTitle$("Contact List");
>>             ^--------------^
>> *** Semantic Error: The class file "UINavigationItem.class" in "/usr/
>> share/java/jocstrap.jar/obc" has an invalid format (bad string
>> annotation constant).
>>
>>
>>    118.     UINavigationItem navitem = new
>> UINavigationItem().initWithTitle$("Contact List");
>>                                            ^--------------^
>> *** Semantic Error: Type "UINavigationItem" was not found.
>>
>>
>>    123.         String name = contacts_.get(i).getName();
>>                               ^------------------------^
>> *** Semantic Error: No accessible method with signature "getName()"
>> was found in type "java.lang.Object".
>>
>>
>>    135.     UISectionList list = new UISectionList().initWithFrame$
>> (lower);
>>             ^-----------^
>> *** Semantic Error: Type "UISectionList" was not found.
>>
>>
>>    135.     UISectionList list = new UISectionList().initWithFrame$
>> (lower);
>>                                      ^-----------^
>> *** Semantic Error: Type "UISectionList" was not found.
>>
>>
>>    138.     UITableColumn col = new UITableColumn().initWithTitle
>> $identifier$width$("Name", "name", 320);
>>             ^-----------^
>> *** Semantic Error: Type "UITableColumn" was not found.
>>
>>
>>    138.     UITableColumn col = new UITableColumn().initWithTitle
>> $identifier$width$("Name", "name", 320);
>>                                     ^-----------^
>> *** Semantic Error: Type "UITableColumn" was not found.
>>
>>
>>    140.     UITable table = (UITable) list.table();
>>             ^-----^
>> *** Semantic Error: Type "UITable" was not found.
>>
>>
>>    140.     UITable table = (UITable) list.table();
>>                              ^-----^
>> *** Semantic Error: Type "UITable" was not found.
>>
>>
>>    143.     table.setReusesTableCells$(YES);
>>                                        ^-^
>> *** Semantic Error: No accessible field named "YES" was found in type
>> "HelloJava".
>> iPhone:/Applications/HelloJava.app root#
>>
>>
>> _______________________________________________
>> iPhone-Java mailing list
>> iPhone-Java at telesphoreo.org
>> http://www.telesphoreo.org/cgi-bin/mailman/listinfo/iphone-java
>>
>
> _______________________________________________
> iPhone-Java mailing list
> iPhone-Java at telesphoreo.org
> http://www.telesphoreo.org/cgi-bin/mailman/listinfo/iphone-java
>



More information about the iPhone-Java mailing list