Editing Java

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
This page is about the Java programming language and Java Virtual Machine.
+
{{Midgard article}}
-
== Current state of affairs ==
+
This page is about the Java programming language and Java Virtual Machine on the Nokia 770.
-
=== Official support ===
+
Thre is no official J2ME or J2SE for the Nokia 770 as of yet.
-
==== SUN ====
+
The Nokia 770's ARM CPU does have a proprietary extenstion called Jazelle that provides two key capabilities for accelerated execution of Java applications.
-
There is no official Java ME or Java SE from SUN as of yet.
+
-
==== Nokia ====
+
These are:
-
Nokia does not plan support because Nokia already supports 2 development platforms with Maemo: either GTK (Maemo 5) or Qt (Maemo 6) as well as WRT (Web Run Time).
+
-
==== N900 Application Manager ====
+
* Jazelle DBX (Direct Bytecode eXecution) technology for direct bytecode execution of Java bytecode instructions
 +
* Jazelle RCT (Runtime Compilation Target) for JIT compilation of Java bytecode instructions to ARM native instructions.
-
Java now available on the N900 via the [http://maemo.org/packages/view/icedtea6/ icedTea6] version of OpenJDK(tm) in [[extras]]. Check your Application Manager for "icedTea6" to install.
+
Use of the Jazelle features is "locked" unless a vendor licenses the ARM Jazelle Technology Enabling Kit (JTEK). It's not clear whether Nokia has chosen to license the JTEK for use with the Nokia 770. While it would be highly desirable for a Jazelle-enhanced JVM to be available for the Nokia 770, it is not necessary to use this technology in order to create a JVM for the 770.
-
=== Hardware support ===
+
For example, it should be feasible to get good results by porting one of the existing open source JVMs to the 770:
-
==== 770/N800/N810(WME) ====
+
* LuisMontes is in the process of porting kaffe to maemo. (Where can further information be found?)
-
The Nokia 770, N800, N810(WME) CPUs have a proprietary extension called Jazelle which accelerates Java execution however this is technology requires a license. Nokia has not opted for such license hence there is no driver for this. For more information about Jazelle please see [[:wikipedia:Jazelle|the Jazelle entry at Wikipedia]].
+
* JamVM has been ported to maemo - here is a link to packages: http://gilles.frattini.free.fr/wordpress/index.php?p=3
-
 
+
** here is a howto describing jamvm building and running a java app on 770: http://www.microemu.org/maemo/
-
==== N900 ====
+
** other debs for jamvm, classpath, and jikes
-
Nokia N900 contains succesor of Jazelle found on ARMv7, called ThumbEE. This is more general JIT; not JVM-specific. Hardware support (driver) of ThumbEE is unknown.
+
** discussion: http://www.internettablettalk.com/forums/showthread.php?t=2896&page=2#12
-
 
+
** applicationcatalogwip page: http://maemo.org/maemowiki/ApplicationCatalog2006Wip#head-27308ca5c27fe7db1e0c2fc21649ffa7b88ff28d
-
== Solutions ==
+
* Interesting mailing list threads:
-
 
+
** http://www.gossamer-threads.com/lists/maemo/developers/12377
-
=== [http://java.sun.com/javase/downloads/embedded.jsp Java SE for embedded 6] ===
+
** there are some more... search...
-
* ARMv6 Linux - Headless (Early Access) EABI, glibc 2.5, Soft Float, Little Endian
+
* Java Phone ME for 770
-
* ARMv6 Linux - Headless (Early Access) EABI, glibc 2.5, Hard Float (VFP), Little Endian
+
** Binaries built by Johannes Eickhold: http://i30www.ira.uka.de/p2p/ambicomp/phoneME_Nokia770/
-
* ARMv6 Linux - Headful (Early Access), EABI, glibc 2.5, Hard Float (VFP), Little Endian
+
** Forum thread: http://forums.java.net/jive/thread.jspa?threadID=20835&tstart=15
-
* ARMv5 Linux - Headless (Early Access), EABI, glibc 2.5, Soft Float, Little Endian
+
** Build instructions: http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvancedPlatformsNokia770
-
* ARMv5 Linux - Headful (Early Access), EABI, glibc 2.5, Soft Float, Little Endian)
+
* JaLiMo - Java-like environment for mobile Linux devices
-
 
+
** http://www.jalimo.org
-
=== OpenJDK 6 JRE ===
+
-
Is ported to Debian GNU/Linux ARMEL therefore should work.
+
-
 
+
-
The [http://mint.camswl.com/openjdk.htm Cambridge ARM-optimised OpenJDK] has been shown to work.
+
-
 
+
-
=== [https://wiki.evolvis.org/jalimo Jalimo] ===
+
-
Aims for Java SE compliance with pre-SUN_Java_GPLed_code, previously ported to Maemo.
+
-
 
+
-
Jalimo maemo 4 repo is giving a permission denied error and appear to be down.
+
-
Development appears to have moved on to openembedded, mailing list still active.
+
-
 
+
-
=== Google Android's Virtual Machine Dalvik ===
+
-
 
+
-
Maemo could greatly profit if it could run all Android apps. If Maemo subsumes Android, there is no reason anymore to choose Android. Moreover there is already an [https://blueprints.launchpad.net/ubuntu/+spec/mobile-karmic-android-execution-environment Ubuntu project] aiming at running Android apps in Ubuntu.
+
-
The [http://mjfrey.blogspot.com/ main developer] does, however, not respond to emails.
+
-
 
+
-
=== [http://code.google.com/p/microemu/wiki/Maemo MicroEmu] ===
+
-
Java ME emulator written in Java SE previously ported to Maemo
+
-
 
+
-
=== [https://phoneme.dev.java.net/ phoneME] ===
+
-
Java ME emulator written in C previously ported to Maemo.
+
-
 
+
-
=== Qt Jambi ===
+
-
Provides Java bindings for Qt. Swing native supported by headful Java versions.
+
-
 
+
-
=== Unsorted ===
+
-
For Java support in Maemo Browser a plugin is required. (References to be written.)
+
-
 
+
-
=== Sun Java SE for embedded ===
+
-
 
+
-
:''Note: this software is proprietary; the OpenJDK is available, see the Cambridge Software Labs section below''
+
-
 
+
-
#Downloaded the Sun Java SE for Embedded (ARMv6 jre 1.6_10 Headful) [https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=ejre-6u10-oth-JPR@CDS-CDS_Developer Download it here]. (XXX old link, double-check)
+
-
#The downloaded file is a gzipped tar (.tar.gz) archive. It's just a different kinda zipfile...it uses a different process for storing and compressing data, but conceptually they're similar.
+
-
#(Do not extract the archive on your PC! You can only copy it to vfat and the executable flags are lost -  MyDocs is a vfat partition and doesn't support executable flags...) <s>If you don't have a program on N900 to open these yet, download it onto my PC. Fedora GNU/Linux automatically fires up an archive manager when you dbl-click the file. There are free Windows utilities to handle these files too (e.g. 7-zip). When you expand (extract, inflate...whatever) this file, it will create a folder called "ejre1.6.0_10" and neatly store all the java software within.</s>
+
-
#Copy it to your device,
+
-
#*If you have SSH configured and networking working (computer and device in the same wireless or USB network), to recursively copy the folder and all its contents to your N900, all you need to do is use the "scp" command (Secure CoPy via SSH) with the "-r" option. You'll need your N900s IP address - there's a very handy little widget for that (thanks to whoever made it!) example: '''scp -r ejre1.6.0_10 root@my.n900.ip.addr:/home/opt/java'''
+
-
#**If both your N900 is connected to your home wifi connection, you should be able to replace the IP address with the host name without modifying any files on your system. You can, instead of an IP address, use your N900's host name. From xterm on your N900: "hostname" By default, this returns "Nokia-N900-42-11" Your scp command on your host computer (need winbind installed on it for this to work) then becomes: "scp -r ejre1.6.0_10 root@Nokia-N900-42-11/home/opt/java" Names are easier to memorize than numbers (assuming you aren't being lazy and using the history)
+
-
#***Or, if not on WiFi, you will need to enter your N900 hostname into your "/etc/hosts" file for your method to work. Your PC will not know WTF "Nokia-N900-42-11" means, otherwise.
+
-
#*Or connect via USB and choose mass storage mode, copy the file over, then disconnect.
+
-
#Open a Terminal and type:
+
-
#:sudo gainroot
+
-
#:mkdir /home/opt/java
+
-
#:cd /home/opt/java
+
-
#:tar -xzvf /home/user/MyDocs/<filename>.tar.gz
+
-
# Next, you'll need to install a link to the main java program, so that when you open an xterm and type "java" it knows what you're talking about. If you've followed my choice of folder location, the java program is located in /home/opt/java/ejre1.6.0_10/bin/java. Open an xterm and use "sudo gainroot" again. Then type "ln -s /home/opt/java/ejre1.6.0_10/bin/java /usr/local/bin/java". This will create a "symlink" (a Symbolic Link....basically a pointer to a file or folder) in /usr/local/bin. You could create it in /usr/bin, but I prefer to keep things separate.
+
-
# You will also need to alter your /etc/profile file slightly. Open it up (with vi), i.e. "vi /etc/profile", and look at the line beginning with "export PATH=", you need to add ":/usr/local/bin" to the end of the path (inside the quotes).
+
-
# Now you will be able to download Java SE jarfiles and run them by typing "java -jar somejarfile.jar"
+
-
# I'm working on registering the ".jar" extension so that you can just dbl-click them to run them....I thought I had it figured out, but it's not working yet.
+
-
 
+
-
[http://web.archive.org/web/20080308015352/http://java.sun.com/products/java-media/2D/samples/java2demo/Java2D.zip Java2D sample] works with this method.
+
-
 
+
-
[http://talk.maemo.org/showpost.php?p=430791&postcount=13 original post]
+
-
[http://talk.maemo.org/showpost.php?p=432083&postcount=24 'lesson' 1]
+
-
 
+
-
To enable Mozilla browser plugin [http://talk.maemo.org/showthread.php?p=959215#post959215]:
+
-
#Extract ejre1.6.0_21 from the archive to MyDocs in N900
+
-
#Move ejre1.6.0_21 to /opt (I was using MC)
+
-
#Run in terminal as root:
+
-
#:ln -s /opt/ejre1.6.0_21/bin/* /usr/bin/
+
-
#:chmod 777 /usr/bin/java
+
-
#:ln –s /opt/ejre1.6.0_21/lib/arm/libnpjp2.so /usr/lib/browser/plugins/libnpjp2.so
+
-
#:ln –s /opt/ejre1.6.0_21/lib/arm/libnpjp2.so /home/user/.mozilla/plugins/libnpjp2.so
+
-
#Then in microB and Firefox type about:config in address
+
-
#Search for java
+
-
#Change java.java_plugin_library_name to libnpjp2.so
+
-
#I don’t know if changing in about:config is needed because I did this at the beginning.
+
-
#After that chromium was running java without any changes.
+
-
 
+
-
=== MicroEmulator ===
+
-
{{main|Microemulator}}
+
-
There is also some [http://talk.maemo.org/showthread.php?p=238027#post238027 micro emulator] thing which may be Java related. [http://talk.maemo.org/showpost.php?p=435335&postcount=53 more of the same] ([http://talk.maemo.org/showpost.php?p=435479&postcount=55 mirror])
+
-
 
+
-
To run a midlet [http://talk.maemo.org/showpost.php?p=494025&postcount=118]:
+
-
# Install JRE
+
-
# Go to http://www.microemu.org/ and download the zip file
+
-
# Unzip the file
+
-
# Go to folder in terminal and run java -jar microemulator.jar
+
-
# Get out your stylus and used the menu to open dbmidlet.jar
+
-
 
+
-
[http://www.microemu.org/maemo this one manual] outdated doesn't work at all. [http://talk.maemo.org/showpost.php?p=511778&postcount=148]
+
-
 
+
-
no gps? [http://talk.maemo.org/showpost.php?p=518089&postcount=161][http://talk.maemo.org/showpost.php?p=518240&postcount=165] [http://talk.maemo.org/showpost.php?p=657320&postcount=240 work in progress]
+
-
 
+
-
[http://talk.maemo.org/showpost.php?p=542689&postcount=193]
+
-
[http://talk.maemo.org/showpost.php?p=542689&postcount=194], confirming the steps above
+
-
 
+
-
I'd like to be able to use it in portrait mode, and ofcourse keyboard support would be nice [http://talk.maemo.org/showpost.php?p=837802&postcount=269]
+
-
 
+
-
=== Cambridge Software Labs OpenJDK for ARM ===
+
-
 
+
-
{{main|OpenJDK 6.0 0 (Cambridge Software Labs) on N900}}
+
-
 
+
-
This is a good free/open-source solution,
+
-
 
+
-
The optimized OpenJDK for ARM on the N900 provided by Cambridge Software Labs (see [http://www.camswl.com/openjdk/])
+
-
 
+
-
[http://talk.maemo.org/showpost.php?p=496437&postcount=122 "works quite well for me"]
+
-
 
+
-
It is without JIT. But they also say that this version gives reasonable performance even without JIT (they say something about "70-80% of the performance of a JIT"). [http://talk.maemo.org/showpost.php?p=508945&postcount=138]
+
-
 
+
-
===porting pspkvm to N900?===
+
-
 
+
-
how about porting pspkvm to N900? pspkvm is a JavaME emulator for the PSP. Link: [http://sourceforge.net/apps/trac/pspkvm]
+
-
 
+
-
pspkvm is itself a port of the [https://phoneme.dev.java.net/ PhoneME] software. Porting directly from PhoneME to Maemo is probably a better bet, rather than going from pspkvm.
+
-
 
+
-
[http://talk.maemo.org/showpost.php?p=460238&postcount=86] [http://talk.maemo.org/showpost.php?p=459131&postcount=82]
+
-
 
+
-
== Brainstorm ==
+
-
Please see [[Task:Brainstorm_Java]] for an effort to outline possible solutions to improve Java support on Nokia N900.
+
[[Category:Development]]
[[Category:Development]]
-
[[Category:N900]]
+
[[Category:Midgard wiki]]
-
 
+
-
== Tutorials ==
+
-
* [http://www.leolol.com/drupal/tutorials/java/lessons Java Programming Lessons]
+
-
* [http://www.leolol.com/drupal/tutorials/java/exercises Java Programming Exercises] with sample solutions
+

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page:

Retrieved from "http://wiki.maemo.org/Java"