Java

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Status on OpenMoko)
(Status on Openmoko: Link to Jalimo on Openmoko wiki.)
 
(32 intermediate revisions by 14 users not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
There are two main types of Java platforms that can be made available on OpenMoko devices such as the Neo1973.
+
There are three main types of Java platforms that can be made available on Openmoko devices such as the Neo1973.
* Java Standard Edition (J2SE)
+
* Java Standard Edition (Java SE)
* Java Micro Edition (J2ME)
+
* Java Micro Edition (Java ME)
 
* Hybrid Solutions
 
* Hybrid Solutions
  
=== Java Standard Edition (J2SE) ===
+
=== Java Standard Edition (Java SE) ===
  
 
This is the incarnation of the desktop version of Sun's Java platform. The majority of its codebase was recently opensourced under the GPL+exception license; the closed bits are quickly being replaced by unencumbered alternatives.
 
This is the incarnation of the desktop version of Sun's Java platform. The majority of its codebase was recently opensourced under the GPL+exception license; the closed bits are quickly being replaced by unencumbered alternatives.
  
When people talk of Java applications, they're usually referring to software targetted to this platform. Application memory footprints on desktop applications usually include the VM and base libraries into account, rather than just the application itself (this isn't the case in J2ME).
+
When people talk of Java applications, they're usually referring to software targeted to this platform. Application memory footprints on desktop applications usually include the VM and base libraries, rather than just the application itself (this isn't the case in Java ME).
  
=== Java Micro Edition (J2ME) ===
+
=== Java Micro Edition (Java ME) ===
  
 
This is the 'lite' edition of the Java platform. Modular and optimised for embedded devices, this platform provides a much more restricted set of language and library features.
 
This is the 'lite' edition of the Java platform. Modular and optimised for embedded devices, this platform provides a much more restricted set of language and library features.
  
J2ME applications are usually referred to as MIDlets (Sun's name for these applications).
+
Java ME applications are usually referred to as MIDlets (Sun's name for these applications).
  
When talking about games, and mobile phone games in general, people are normally referring to this platform. J2ME games and applications are expected to function within the strict memory capabilities of the corresponding platform (application descriptors allow the runtime environment to know for which they are intended).
+
When talking about games and mobile phone games in general, people are normally referring to this platform. Java ME games and applications are expected to function within the strict memory capabilities of the corresponding platform (application descriptors allow the runtime environment to know for which they are intended).
  
Memory footprints of MIDlets written for J2ME are typically quoted exclusive of the VM or base libraries - this is because they are often delivered to Java-enabled devices over the network. Footprint sizes average 10-64KB, with recent devices supporting up to 1MB MIDlets.
+
Memory footprints of MIDlets written for Java ME are typically quoted exclusive of the VM or base libraries -- this is because they are often delivered to Java-enabled devices over the network. Footprint sizes average 10-64KB, with recent devices supporting up to 1MB MIDlets.
  
 
MIDlet are delivered as two files:
 
MIDlet are delivered as two files:
Line 27: Line 27:
 
=== Hybrid Solutions ===
 
=== Hybrid Solutions ===
  
Other approaches include mixing and matching J2SE and J2ME in various ways. Standard methods include providing a compatibility layer on top of J2SE to allow it to run J2ME and expanding J2ME to provide more J2SE features.
+
Other approaches include mixing and matching Java SE and Java ME in various ways. Standard methods include providing a compatibility layer on top of Java SE (like [http://www.microemu.org/ microemu]) to allow it to run Java ME and expanding Java ME to provide more Java SE features.
  
 
Another possible approach would be to have every application compiled to native with gcj when installed and then run without a JVM, with a much faster startup. This may be risky and needs a specialized installer.
 
Another possible approach would be to have every application compiled to native with gcj when installed and then run without a JVM, with a much faster startup. This may be risky and needs a specialized installer.
Line 33: Line 33:
 
== Implementations ==
 
== Implementations ==
  
=== J2SE implementations ===
+
=== Java SE implementations ===
* [http://www.cacaojvm.org/ Cacao] is a Java Virtual Machine (JVM) which uses Just-In-Time (JIT) compilation to execute Java methods natively.
+
* [http://openjdk.java.net/ OpenJDK], the open-sourced implementation of the Java Platform Standard Edition.
* [http://jamvm.sourceforge.net/ JamVM] is a JVM with a very small footprint (<160k).
+
* [http://en.wikipedia.org/wiki/Icedtea Icedtea], basically OpenJDK with some improvements (initially from Redhat) to ease incorporating into free software distributions.
 +
* [http://www.cacaojvm.org/ Cacao] is a GPL Java-Virtual-Machine(JVM) which uses Just-In-Time(JIT) compilation combined either with Icedtea/OpenJDK or [http://www.gnu.org/software/classpath/ Classpath].
 +
* [http://jamvm.sourceforge.net/ JamVM], another GPL JVM with very small footprint (<160k) combined with  [http://www.gnu.org/software/classpath/ Classpath] classes.
 +
* [http://harmony.apache.org/index.html Apache Harmony], is the Java SE project of the Apache Software Foundation.
  
=== J2ME implementations ===
+
=== Java ME implementations ===
 
* [https://phoneme.dev.java.net/ PhoneME] is basically the code base of Sun's commercial Java ME implementation without those components that Sun can't --or won't-- release to the open source community. It is licensed under GPL2. There are actually two versions of PhoneME:
 
* [https://phoneme.dev.java.net/ PhoneME] is basically the code base of Sun's commercial Java ME implementation without those components that Sun can't --or won't-- release to the open source community. It is licensed under GPL2. There are actually two versions of PhoneME:
*;PhoneME Feature: is an implementation of the CLDC (Connected Limited Device Configuration) and MIDP2 (Mobile Information Device Profile) as is common on feature phones (e.g. 'normal', non-smart phones).
+
** '''PhoneME Feature:''' is an implementation of the CLDC (Connected Limited Device Configuration) and MIDP2 (Mobile Information Device Profile) as is common on feature phones (e.g. 'normal', non-smart phones).
*;PhoneME Advanced: is an implementation of the more complex CDC (Connected Device Configuration), designed for more advanced handsets.
+
** '''PhoneME Advanced:''' is an implementation of the more complex CDC (Connected Device Configuration), designed for more advanced handsets.{{Note|this runtime and library can be made available for OpenMoko through OpenEmbedded easily.}}
 
* [http://midpath.thenesis.org MIDPath] is a Java library which provides a MIDP2 implementation and can be used together with the CLDC version of the Cacao to provide an alternative implementation of CLDC/MIDP.
 
* [http://midpath.thenesis.org MIDPath] is a Java library which provides a MIDP2 implementation and can be used together with the CLDC version of the Cacao to provide an alternative implementation of CLDC/MIDP.
 +
* [http://www.microemu.org/ Microemu]: a Java ME emulator that runs on top of Java SE. If the overhead is small enough, it should be the "cheapest" solution.
  
== Status on OpenMoko ==
+
== Status on Openmoko ==
[http://java-pkg.projects.openmoko.org/ Java-pkg] is a [http://projects.openmoko.org/ projects.openmoko.org] [http://projects.openmoko.org/projects/java-pkg/ project] whose aim it is to "Get Java going on OpenMoko, and once it's running, maintain it. There are two sub-projects, one for JME and one for JSE. Priority is currently given to JME CDC profile." There is currently a work-in-progress recipe for PhoneME Advanced in their SVN, which doesn't fully build, as well as a working recipe for PhoneME Feature, which only works directly on the Neo1973 framebuffer (e.g. you'll have to stop Xfbdev).
+
[http://java-pkg.projects.openmoko.org/ Java-pkg] is a [http://projects.openmoko.org/ projects.openmoko.org] [http://projects.openmoko.org/projects/java-pkg/ project] whose aim it is to "Get Java going on Openmoko, and once it's running, maintain it. There are two subprojects, one for JME and one for JSE. Priority is currently given to JME CDC profile." There is currently a work-in-progress recipe for PhoneME Advanced in their SVN, which doesn't fully build, as well as a working recipe for PhoneME Feature, which only works directly on the Neo1973 framebuffer (e.g. you'll have to stop Xfbdev).
  
 +
[[Jalimo]] is a project to feature the integration of free Java-like implementations for free platforms. They already have [https://wiki.evolvis.org/jalimo/index.php/Packages#OpenMoko packages for Openmoko], covering Cacao, GNU Classpath (with Swing support), PhoneME Advanced Foundation/Personal, SWT and the java-gnome bindings, which allows writing GTK+ applications in Java. Build recipes are part of OpenEmbedded and maintained therein. This [https://wiki.evolvis.org/jalimo/index.php/OpenMoko article] describes, how to get started, if you want to install and use Jalimo on Openmoko based systems.
  
[http://www.jalimo.org Jalimo] is a project, to feature the integration of free java for free platforms. They already
+
On [[Debian]], both [http://packages.debian.org/sid/cacao-oj6-jre CacaoVM] and [http://packages.debian.org/sid/jamvm JamVM] SE-JREs have been ported, and although JamVM is considerably faster at start-up, CacaoVM offers a full JSE-1.5 implementation from [http://en.wikipedia.org/wiki/Icedtea Icedtea] than JamVM's [http://www.gnu.org/software/classpath/ GNU-Classpath] classes.
have [http://www.jalimo.org/wiki/doku.php?id=packages#openmoko_2007.2 packages for Openmoko 2007.2], covering cacao, gnu classpath (with swing support) and the java-gnome bindings, which allow writing openmoko GTK applications in Java.
+
The [http://www.microemu.org/index.html microemu] can be used on top of CacaoVM to run PhoneME applications (MIDlets etc).
  
 
== Licensing ==
 
== Licensing ==
Line 58: Line 63:
 
== Links ==
 
== Links ==
  
Google should be your first port of call for most things Java as it would be impossible to give a comprehensive list of all the useful information out there. That being said, below is a selected list of further information resources.
+
Google should be your main resource for most Java-related topics. Below is a selected list of further information resources.
  
=== J2SE Links ===
+
=== Java SE Links ===
  
In 2006/7 Sun [[http://www.deviceforge.com/news/NS9280947932.html acquired the assets of Savaje]], which included a port of J2SE to ARM Linux. This was used to build the "JavaFX" modules and, in fact, it runs on the Neo1973 already. They used it to show JavaFX at the JavaOne 2007: http://java.sun.com/javaone/sf/media_shell.jsp?id=193609 See also http://blogs.sun.com/jonathan/entry/when_not_where
+
In 2006/7 Sun [http://www.deviceforge.com/news/NS9280947932.html acquired the assets of Savaje], which included a port of J2SE to ARM Linux. This was used to build the "JavaFX" modules and, in fact, it runs on the Neo1973 already. They used it to show JavaFX at the JavaOne 2007: http://java.sun.com/javaone/sf/media_shell.jsp?id=193609 See also http://blogs.sun.com/jonathan/entry/when_not_where
  
=== J2ME Links ===
+
=== Java ME Links ===
  
[[Category:Software]]
+
 
[[Category:Developer software]]
+
[[Category:Application Developer]]
[[Category:Unimplemented]]
+

Latest revision as of 12:24, 6 July 2009

Contents

[edit] Introduction

There are three main types of Java platforms that can be made available on Openmoko devices such as the Neo1973.

  • Java Standard Edition (Java SE)
  • Java Micro Edition (Java ME)
  • Hybrid Solutions

[edit] Java Standard Edition (Java SE)

This is the incarnation of the desktop version of Sun's Java platform. The majority of its codebase was recently opensourced under the GPL+exception license; the closed bits are quickly being replaced by unencumbered alternatives.

When people talk of Java applications, they're usually referring to software targeted to this platform. Application memory footprints on desktop applications usually include the VM and base libraries, rather than just the application itself (this isn't the case in Java ME).

[edit] Java Micro Edition (Java ME)

This is the 'lite' edition of the Java platform. Modular and optimised for embedded devices, this platform provides a much more restricted set of language and library features.

Java ME applications are usually referred to as MIDlets (Sun's name for these applications).

When talking about games and mobile phone games in general, people are normally referring to this platform. Java ME games and applications are expected to function within the strict memory capabilities of the corresponding platform (application descriptors allow the runtime environment to know for which they are intended).

Memory footprints of MIDlets written for Java ME are typically quoted exclusive of the VM or base libraries -- this is because they are often delivered to Java-enabled devices over the network. Footprint sizes average 10-64KB, with recent devices supporting up to 1MB MIDlets.

MIDlet are delivered as two files:

  • a .jad MIDlet metadata descriptor
  • a .jar MIDlet container, containing executable bytecode and any required resources

[edit] Hybrid Solutions

Other approaches include mixing and matching Java SE and Java ME in various ways. Standard methods include providing a compatibility layer on top of Java SE (like microemu) to allow it to run Java ME and expanding Java ME to provide more Java SE features.

Another possible approach would be to have every application compiled to native with gcj when installed and then run without a JVM, with a much faster startup. This may be risky and needs a specialized installer.

[edit] Implementations

[edit] Java SE implementations

  • OpenJDK, the open-sourced implementation of the Java Platform Standard Edition.
  • Icedtea, basically OpenJDK with some improvements (initially from Redhat) to ease incorporating into free software distributions.
  • Cacao is a GPL Java-Virtual-Machine(JVM) which uses Just-In-Time(JIT) compilation combined either with Icedtea/OpenJDK or Classpath.
  • JamVM, another GPL JVM with very small footprint (<160k) combined with Classpath classes.
  • Apache Harmony, is the Java SE project of the Apache Software Foundation.

[edit] Java ME implementations

  • PhoneME is basically the code base of Sun's commercial Java ME implementation without those components that Sun can't --or won't-- release to the open source community. It is licensed under GPL2. There are actually two versions of PhoneME:
    • PhoneME Feature: is an implementation of the CLDC (Connected Limited Device Configuration) and MIDP2 (Mobile Information Device Profile) as is common on feature phones (e.g. 'normal', non-smart phones).
    • PhoneME Advanced: is an implementation of the more complex CDC (Connected Device Configuration), designed for more advanced handsets.
NOTE: this runtime and library can be made available for OpenMoko through OpenEmbedded easily.


  • MIDPath is a Java library which provides a MIDP2 implementation and can be used together with the CLDC version of the Cacao to provide an alternative implementation of CLDC/MIDP.
  • Microemu: a Java ME emulator that runs on top of Java SE. If the overhead is small enough, it should be the "cheapest" solution.

[edit] Status on Openmoko

Java-pkg is a projects.openmoko.org project whose aim it is to "Get Java going on Openmoko, and once it's running, maintain it. There are two subprojects, one for JME and one for JSE. Priority is currently given to JME CDC profile." There is currently a work-in-progress recipe for PhoneME Advanced in their SVN, which doesn't fully build, as well as a working recipe for PhoneME Feature, which only works directly on the Neo1973 framebuffer (e.g. you'll have to stop Xfbdev).

Jalimo is a project to feature the integration of free Java-like implementations for free platforms. They already have packages for Openmoko, covering Cacao, GNU Classpath (with Swing support), PhoneME Advanced Foundation/Personal, SWT and the java-gnome bindings, which allows writing GTK+ applications in Java. Build recipes are part of OpenEmbedded and maintained therein. This article describes, how to get started, if you want to install and use Jalimo on Openmoko based systems.

On Debian, both CacaoVM and JamVM SE-JREs have been ported, and although JamVM is considerably faster at start-up, CacaoVM offers a full JSE-1.5 implementation from Icedtea than JamVM's GNU-Classpath classes. The microemu can be used on top of CacaoVM to run PhoneME applications (MIDlets etc).

[edit] Licensing

[edit] VM Licensing

[edit] MIDlet Licensing

[edit] Links

Google should be your main resource for most Java-related topics. Below is a selected list of further information resources.

[edit] Java SE Links

In 2006/7 Sun acquired the assets of Savaje, which included a port of J2SE to ARM Linux. This was used to build the "JavaFX" modules and, in fact, it runs on the Neo1973 already. They used it to show JavaFX at the JavaOne 2007: http://java.sun.com/javaone/sf/media_shell.jsp?id=193609 See also http://blogs.sun.com/jonathan/entry/when_not_where

[edit] Java ME Links

Personal tools

Introduction

There are two main types of Java platforms that can be made available on OpenMoko devices such as the Neo1973.

  • Java Standard Edition (J2SE)
  • Java Micro Edition (J2ME)
  • Hybrid Solutions

Java Standard Edition (J2SE)

This is the incarnation of the desktop version of Sun's Java platform. The majority of its codebase was recently opensourced under the GPL+exception license; the closed bits are quickly being replaced by unencumbered alternatives.

When people talk of Java applications, they're usually referring to software targetted to this platform. Application memory footprints on desktop applications usually include the VM and base libraries into account, rather than just the application itself (this isn't the case in J2ME).

Java Micro Edition (J2ME)

This is the 'lite' edition of the Java platform. Modular and optimised for embedded devices, this platform provides a much more restricted set of language and library features.

J2ME applications are usually referred to as MIDlets (Sun's name for these applications).

When talking about games, and mobile phone games in general, people are normally referring to this platform. J2ME games and applications are expected to function within the strict memory capabilities of the corresponding platform (application descriptors allow the runtime environment to know for which they are intended).

Memory footprints of MIDlets written for J2ME are typically quoted exclusive of the VM or base libraries - this is because they are often delivered to Java-enabled devices over the network. Footprint sizes average 10-64KB, with recent devices supporting up to 1MB MIDlets.

MIDlet are delivered as two files:

  • a .jad MIDlet metadata descriptor
  • a .jar MIDlet container, containing executable bytecode and any required resources

Hybrid Solutions

Other approaches include mixing and matching J2SE and J2ME in various ways. Standard methods include providing a compatibility layer on top of J2SE to allow it to run J2ME and expanding J2ME to provide more J2SE features.

Another possible approach would be to have every application compiled to native with gcj when installed and then run without a JVM, with a much faster startup. This may be risky and needs a specialized installer.

Implementations

J2SE implementations

  • Cacao is a Java Virtual Machine (JVM) which uses Just-In-Time (JIT) compilation to execute Java methods natively.
  • JamVM is a JVM with a very small footprint (<160k).

J2ME implementations

  • PhoneME is basically the code base of Sun's commercial Java ME implementation without those components that Sun can't --or won't-- release to the open source community. It is licensed under GPL2. There are actually two versions of PhoneME:
    PhoneME Feature
    is an implementation of the CLDC (Connected Limited Device Configuration) and MIDP2 (Mobile Information Device Profile) as is common on feature phones (e.g. 'normal', non-smart phones).
    PhoneME Advanced
    is an implementation of the more complex CDC (Connected Device Configuration), designed for more advanced handsets.
  • MIDPath is a Java library which provides a MIDP2 implementation and can be used together with the CLDC version of the Cacao to provide an alternative implementation of CLDC/MIDP.

Status on OpenMoko

Java-pkg is a projects.openmoko.org project whose aim it is to "Get Java going on OpenMoko, and once it's running, maintain it. There are two sub-projects, one for JME and one for JSE. Priority is currently given to JME CDC profile." There is currently a work-in-progress recipe for PhoneME Advanced in their SVN, which doesn't fully build, as well as a working recipe for PhoneME Feature, which only works directly on the Neo1973 framebuffer (e.g. you'll have to stop Xfbdev).


Jalimo is a project, to feature the integration of free java for free platforms. They already have packages for Openmoko 2007.2, covering cacao, gnu classpath (with swing support) and the java-gnome bindings, which allow writing openmoko GTK applications in Java.

Licensing

VM Licensing

MIDlet Licensing

Links

Google should be your first port of call for most things Java as it would be impossible to give a comprehensive list of all the useful information out there. That being said, below is a selected list of further information resources.

J2SE Links

In 2006/7 Sun [acquired the assets of Savaje], which included a port of J2SE to ARM Linux. This was used to build the "JavaFX" modules and, in fact, it runs on the Neo1973 already. They used it to show JavaFX at the JavaOne 2007: http://java.sun.com/javaone/sf/media_shell.jsp?id=193609 See also http://blogs.sun.com/jonathan/entry/when_not_where

J2ME Links