Java

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Introduction)
(Status on Openmoko: Link to Jalimo on Openmoko wiki.)
 
(6 intermediate revisions by 4 users not shown)
Line 33: Line 33:
 
== Implementations ==
 
== Implementations ==
  
=== J2SE implementations ===
+
=== Java SE implementations ===
 
* [http://openjdk.java.net/ OpenJDK], the open-sourced implementation of the Java Platform Standard Edition.
 
* [http://openjdk.java.net/ OpenJDK], the open-sourced implementation of the Java Platform Standard Edition.
 
* [http://en.wikipedia.org/wiki/Icedtea Icedtea], basically OpenJDK with some improvements (initially from Redhat) to ease incorporating into free software distributions.
 
* [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://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://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.{{Note|this runtime and library can be made available for OpenMoko through OpenEmbedded easily.}}
 
** '''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 J2ME emulator that runs on top of J2SE. If the overhead is small enough, it should be the "cheapest" solution.
+
* [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 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).
 
[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-like implementations for free platforms. They already 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), 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.
+
  
 
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.
 
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.
Line 65: Line 65:
 
Google should be your main resource for most Java-related topics. 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:Application Developer]]
 
[[Category:Application Developer]]

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 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

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).

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

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.

Implementations

J2SE 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.

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.
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 J2ME emulator that runs on top of J2SE. If the overhead is small enough, it should be the "cheapest" solution.

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 2007.2, 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.

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).

Licensing

VM Licensing

MIDlet Licensing

Links

Google should be your main resource for most Java-related topics. 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