http://wiki.webos-internals.org/api.php?action=feedcontributions&user=Yannick56&feedformat=atom
WebOS Internals - User contributions [en]
2024-03-29T07:44:38Z
User contributions
MediaWiki 1.35.1
http://wiki.webos-internals.org/index.php?title=WebOS_Survival_Kit-FR&diff=21971
WebOS Survival Kit-FR
2014-03-23T16:20:17Z
<p>Yannick56: (synchronization done with english wiki page / synchronisation terminée avec la page corespondante du wiki en anglais)</p>
<hr />
<div>[[Category:French]]<br />
<br />
Cette page est disponible dans les 4 langues suivantes:<br />
:[[Image:Australia.png]] [[Image:USA.png]] [[WebOS_Survival_Kit|WebOSSurvival Kit]]<br />
:[[Image:France.png]] [[WebOS_Survival_Kit-FR| webOS Survival Kit (Kit de survie webOS)]]<br />
:[[Image:Germany.png]] [[WebOS_Survival_Kit-DE| webOS Survival Kit (Überlebensset)]]<br />
:[[image:Italy.png]] [[Kit_di_Sopravvivenza_webOS|Kit di Sopravvivenza webOS]]<br />
<br />
''Nous sommes en 2013. C'est un monde post-webOS.''<br />
<br />
''HP a vendu l'entité webOS, et l'acheteur l'a dépouillé de ces brevets, puis il a fermé toutes les infrastructures nécessaires pour supporter les appareils sous webOS.''<br />
<br />
''Les serveurs hébergeant le catalogue d'applications HP (HP App Catalog) et les profils Palm des utilisateurs ne peuvent plus être atteint (puisque hors service).''<br />
<br />
''Les comptes Twitter @palm et @webOSdev ne répond plus. Les forums des développeurs sont un désert aride.''<br />
<br />
''Certaines personnes choisissent la voie la plus facile et passent tout simplement à une autre plate-forme (fonctionnant sur un autre OS).''<br />
<br />
''D'autres apprennent à survivre, à l'aide du''... '''''Kit de survie webOS (webOS Survival Kit)'''''<br />
<br />
= Suivez le fil Twitter @webosinternals =<br />
<br />
Créez un compte Twitter et suivez le fil [http://twitter.com/webosinternals @webosinternals]. Pensez-le comme votre système d'alerte avancé et votre seul moyen de communication par radio à ondes courtes à longue distance. Lorsque le désastre arrivera, surveiller le pour y trouver de nouvelles instructions.<br />
<br />
Les autres principaux développeurs homebrew à suivre sont: [http://twitter.com/JayCanuck @JayCanuck] et [http://twitter.com/therealsconix @TheRealSconix]<br />
<br />
Ndt: Avant l'utilisation des satellites de télécommunication dans les années 1960, la communication radio par [http://fr.wikipedia.org/wiki/Haute_fr%C3%A9quence ondes courtes] était le seul moyen pour communiquer entre 2 points éloignés sur la Terre et elles sont toujours utilisés par les [http://fr.wikipedia.org/wiki/Radioamateur radio-amateurs].<br />
<br />
= Installer la [http://bit.ly/phd-ac Documentation Homebrew Preware (Preware Homebrew Documentation)] =<br />
<br />
Dans un monde post-webOS, vous aurez besoin d'avoir l'application Preware installé sur votre appareil. Le catalogue d'applications HP (HP App Catalog) ne sera plus disponible pour vous, donc vous avez besoin de récupérer la documentation dont vous avez besoin pour installer l'application Preware maintenant (Ndr : catalogue alternatif au catalogue d'applications HP).<br />
<br />
L'application [http://bit.ly/phd-ac Preware Homebrew Documentation (Documentation Homebrew Preware)] va vous guider pas à pas et de manière détaillé dans les différentes étapes à suivre des instructions d'installation.<br />
<br />
Ndt : Pour les francophones, l'installation de l'application "Documentation Homebrew Preware" peut-être optionnelle, par contre il existe des ressources en français pour cette installation de Preware qui sont : [http://www.webos-internals.org/wiki/Application:Preware-FR Preware à webos-internals.org] et [http://www.webosfrance.com/Video-Preware-Boostez-votre-terminal--Ajoutez-des-milliers-de-fonctionnalites-a-WebOS_a480.html Video installation Preware à webosfrance.com]<br />
<br />
= Installer l'application Preware =<br />
<br />
Suivez les instructions dans l'application [http://bit.ly/phd-ac Preware Homebrew Documentation (Documentation Homebrew Preware)] pour le faire. Ne tardez pas, vous devez déjà avoir installé Preware, pas après que HP et webOS s'en seront allés.<br />
<br />
Si vous avez des problèmes pour exécuter le logiciel "WebOS Quick Install" (surtout si vous êtes sur un ordinateur sous MS Windows), installez l'application [http://bit.ly/wosqi-guide WOSQI Homebrew Guide] et suivez le guide de dépannage qui est dedans.<br />
<br />
Ne vous reposez pas tant que vous n'aurez pas installé Preware et ensuite qu'il fonctionnera . Il est votre clé pour la distribution et l'installation d'applications dans un monde post-webOS.<br />
<br />
En suivant ces instructions, vous pourrez aussi vous retrouver avec le logiciel WebOS Quick Install installé et disponible sur votre ordinateur hôte. De multiples manières redondantes d'installer des choses sont des éléments clé dans un monde post-webOS.<br />
<br />
Ndt : Pour les francophones, les ressources en français pour cette installation de Preware sont : [http://www.webos-internals.org/wiki/Application:Preware-FR Preware à webos-internals.org] et [http://www.webosfrance.com/Video-Preware-Boostez-votre-terminal--Ajoutez-des-milliers-de-fonctionnalites-a-WebOS_a480.html Video installation Preware à webosfrance.com]<br />
<br />
= Vider votre profil =<br />
<br />
Les données contenues dans votre compte HP webOS (anciennement le profil Palm) (en ligne) ne seront plus disponibles pour vous dans un monde post-webOS.<br />
<br />
Déplacez les toutes ailleurs dès maintenant. Votre appareil webOS supporte un certain nombre de fournisseurs avec Synergy - choisissez en un avec qui vous êtes le plus l'aise et déplacer toutes vos données chez lui.<br />
<br />
Une des options possibles consiste à [[Backup your contacts to Gmail|Sauvegarder vos contacts dans Gmail(en anglais)]].<br />
<br />
= Installer l'application Save/Restore =<br />
<br />
Allez dans Preware. Recherchez l'application "Save/Restore" et installez l'application. Enregistrez les paramètres de vos/votre application(s).<br />
<br />
Si vous dépendez (comptez) sur une application qui n'est pas supportée par "Save/Restore", alors allez sur le [http://forums.precentral.net/webos-internals/237558-save-restore-community-development.html fil de discussion Save/Restore du forum] sur le site web webOS Nation et proposer de mettre en place une prime financière pour que les développeurs ajoutent le support de cette application.<br />
<br />
Assurez-vous bien que vous copiez le contenu du répertoire saverestore à partir de votre appareil webOS vers votre ordinateur hôte (ou un compte de stockage en ligne) régulièrement.<br />
<br />
Plus d'informations en français sur l'application "Save/Restore": [http://www.webos-internals.org/wiki/Application:SaveRestore-FR SaveRestore en français]<br />
<br />
= Sauvegarder vos paramètres (Tokens) =<br />
<br />
Installer l'application "Show Properties" à partir de Preware, et envoyez à vous-même un courriel contenant la liste '''Full(complète)''' des paramètres (utilisez l'option '''Full(complète)''' du menu, et non pas l'option '''Comms Board Swap (carte de communication embarqué ???)''' du menu).<br />
<br />
Ne vous inquiétez pas sur ce que cela signifie en ce moment, faites le tout simplement. Avec la liste des paramètres et le logiciel webOS Doctor vous pouvez faire revivre votre appareil ayant subi n'importe quelle calamité.<br />
<br />
= Téléchargez le logiciel webOS Doctor =<br />
<br />
Assurez-vous d'avoir la version correcte de webOS Doctor (version, type appareil, opérateur mobile) pour votre appareil et qui a été téléchargé sur les serveurs de HP et est disponible en local sur votre ordinateur hôte.<br />
<br />
Visitez notre page web [[WebOS_Doctor_Versions|webOS Doctor Versions]] et téléchargez la version correcte de webOS Doctor pour votre appareil dès maintenant.<br />
<br />
Dans un monde post-webOS, le logiciel webOS Doctor ne sera plus disponible sur les serveurs de HP, donc assurez vous bien d'avoir votre propre copie de webOS Doctor sauvegardée chez vous dès maintenant.<br />
<br />
= Etre prêt à travailler en ligne de commande =<br />
<br />
Pour pouvoir réaliser certaines mesures clé de survie, vous aurez besoin d'avoir un moyen d'accéder à l'interface en ligne de commande du système d'exploitation Linux de votre appareil.<br />
<br />
Les binaires des derniers pilotes Novacom peut être récupérés en bas de la page sur le site http://opensource.palm.com/packages.html. Dans un monde post-webOS, cette page ne sera plus accessible. Téléchargez dès à présent les pilotes pour les plates-formes (système d'exploitation) actuelles et futures de votre ordinateur hôte (PC, Mac, etc...) avant qu'ils ne disparaissent.<br />
<br />
Installez les pilotes et tester bien si votre ordinateur hôte reconnaît votre appareil/périphérique webOS lorsque vous le branchez à votre ordinateur.<br />
<br />
Entrainz-vous à savoir utiliser novaterm ou l'interface en ligne de commande de WOSQI (qui est une surcouche (wrapper) avec une interface graphique encapsulant ou au-dessus d'une connexion Novacom) pour accéder à l'interface en ligne de commande Linux de votre appareil.<br />
<br />
Le [http://bit.ly/wosqi-guide WOSQI Homebrew Guide (Guide Homebrew WOSQI)] contient un procédure visuelle sur la façon d'accéder à la ligne de commande sur votre appareil depuis un ordinateur hôte.<br />
<br />
Installez Xecutah pour accéder à la ligne de commande à partir de votre appareil.<br />
<br />
Beaucoup de techniques de survie post-webOS peuvent nécessiter des interactions/opérations en ligne de commande. Soyez prêt pour cela dès maintenant. Apprenez quelques techniques d' [[Basic Linux Use|Utilisation de base de Linux (en anglais)]] ou ici [http://wiki.linux-france.org/wiki/Les_commandes_fondamentales_de_Linux "Les commandes fondamentales de Linux" (en français)] avant qu'il ne soit trop tard.<br />
<br />
= Qu'est-propos de l'activation? =<br />
<br />
Il existe des techniques disponibles pour tous les appareils webOS pour contourner l'ensemble des pré-requis de l'activation pour l'opérateur de téléphonie mobile et pour HP/Palm. Nous pouvons prendre un tout nouveau appareil webOS qui n'a jamais été utilisé et le rendre pleinement fonctionnel sans avoir accès à tous les serveurs HP/Palm.<br />
Pour celà, il faut utiliser [http://www.webos-internals.org/wiki/Application:MetaDoctor-FR MetaDoctor]<br />
<br />
= Que faire concernant mes applications? =<br />
<br />
Lorsque le catalogue d'applications HP (HP App catalog) sera fermé, nous aurons besoin d'être en mesure de réinstaller les applications payantes que nous avons achetés sur les appareils pour lesquels ils ont été achetés.<br />
<br />
[http://bit.ly/webos-survival-kit WebOS Survival Kit(Le Kit de Survie webOS)] comprend tout ce dont vous avez besoin pour être prêt à suivre de nouvelles instructions afin de pouvoir le faire lorsque l'éventualité se présentera.<br />
<br />
Les outils requis pour reconditionner les applications afin de les ré-installer via Preware ont déjà été écrit et testé.<br />
<br />
Évidemment, puisque le catalogue des applications est toujours en fonctionnement, il n'est pas encore approprié de donner ces instructions.<br />
<br />
= Préparer tous les appareils webOS =<br />
<br />
Effectuer toutes les étapes ci-dessus pour chaque appareil webOS que vous possédez.<br />
<br />
= Acheter des batteries =<br />
<br />
Les batteries ne vont pas durer éternellement et elles cesseront d'être fabriquées dans un monde post-webOS. Assurez-vous d'en avoir un couple afin de pouvoir tenir le coup.<br />
<br />
Sur tous les appareils webOS autres que le TouchPad, il est possible de remplacer directement les batteries (votre garantie sera belle et bien expirée à cette date).<br />
<br />
Pour le TouchPad, [http://www.ifixit.com/Guide/Installing-HP-TouchPad-Battery/6082/1 ce n'est pas facile du tout]. Donc cette astuce ne s'applique uniquement qu'aux téléphones sous webOS.<br />
<br />
= Faire part de vos astuces =<br />
<br />
Abonnez-vous au [http://forums.precentral.net/webos-internals/303114-webos-survival-kit.html fil de discussion du forum correspondant] dans le [http://forums.precentral.net/webos-internals/ le forum WebOS Internals] et postez-y d'autres astuces pour leur ajout dans [http://bit.ly/webos-survival-kit Le Kit de Survie webOS] ou modifiez cette page du wiki directement.<br />
<br />
= Faire passer le mot =<br />
<br />
Assurez-vous que chaque utilisateur de webOS a l'adresse http://bit.ly/webos-survival-kit (l'URL officielle de cette page) mémorisé dans sa tête. Écrivez le sur un bout de papier, et coller le sur votre moniteur/écran. Ne l'oubliez jamais, vous finirez par en avoir besoin.<br />
<br />
= S'abonner aux forums =<br />
<br />
Il y a un certain nombre de forums de webOS avec de nombreux autres utilisateurs qui peuvent vous aider dans cette période de besoin.<br />
<br />
[http://www.webosnation.com WebOS Nation] est la principale source d'information de premier plan en anglais. Pouir ceux qui veulent consulter des articles de l'ancien site web webOSRoundup, allez sur l'archive de [https://web.archive.org/web/20120902001533/http://www.webosroundup.com/ webOSRoundup ICI].Ndt : Pour les francophones, et plus particulièrement la France, la seule source d'information est [http://www.webosfrance.com/ webOS France].<br />
<br />
= Faire un don =<br />
<br />
Les développeurs homebrew qui vous apportent ces outils reposent sur des dons pour pouvoir continuer à le faire.<br />
<br />
Internals WebOS: http://donate.webos-internals.org/<br />
<br />
Jason Robitaille: http://donate.canuckcoding.ca/<br />
<br />
= Ne paniquez pas =<br />
<br />
WebOS Internals et d'autres développeurs homebrew sont votre support (have your back). Ne paniquez pas.<br />
<br />
Vous serez en mesure d'utiliser votre appareil webOS aussi longtemps qu'il vous plaîra, même si tout le support et l'infrastructure de HP disparaît pendant une nuit.<br />
<br />
[http://farm3.static.flickr.com/2593/3892664015_e410aac714.jpg Nous sommes là pour vous.]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=WebOS_Survival_Kit-FR&diff=21969
WebOS Survival Kit-FR
2014-03-23T16:02:48Z
<p>Yannick56: /* S'abonner aux forums */ sync with the english page</p>
<hr />
<div><br />
[[Category:French]]<br />
<br />
Cette page est disponible dans les 4 langues suivantes:<br />
:[[Image:Australia.png]] [[Image:USA.png]] [[WebOS_Survival_Kit|WebOSSurvival Kit]]<br />
:[[Image:France.png]] [[WebOS_Survival_Kit-FR| webOS Survival Kit (Kit de survie webOS)]]<br />
:[[Image:Germany.png]] [[WebOS_Survival_Kit-DE| webOS Survival Kit (Überlebensset)]]<br />
:[[image:Italy.png]] [[Kit_di_Sopravvivenza_webOS|Kit di Sopravvivenza webOS]]<br />
<br />
''Nous sommes en 2013. C'est un monde post-webOS.''<br />
<br />
''HP a vendu l'entité webOS, et l'acheteur l'a dépouillé de ces brevets, puis il a fermé toutes les infrastructures nécessaires pour supporter les appareils sous webOS.''<br />
<br />
''Les serveurs hébergeant le catalogue d'applications HP (HP App Catalog) et les profils Palm des utilisateurs ne peuvent plus être atteint (puisque hors service).''<br />
<br />
''Les comptes Twitter @palm et @webOSdev ne répond plus. Les forums des développeurs sont un désert aride.''<br />
<br />
''Certaines personnes choisissent la voie la plus facile et passent tout simplement à une autre plate-forme (fonctionnant sur un autre OS).''<br />
<br />
''D'autres apprennent à survivre, à l'aide du''... '''''Kit de survie webOS (webOS Survival Kit)'''''<br />
<br />
= Suivez le fil Twitter @webosinternals =<br />
<br />
Créez un compte Twitter et suivez le fil [http://twitter.com/webosinternals @webosinternals]. Pensez-le comme votre système d'alerte avancé et votre seul moyen de communication par radio à ondes courtes à longue distance. Lorsque le désastre arrivera, surveiller le pour y trouver de nouvelles instructions.<br />
<br />
Les autres principaux développeurs homebrew à suivre sont: [http://twitter.com/JayCanuck @JayCanuck] et [http://twitter.com/therealsconix @TheRealSconix]<br />
<br />
Ndt: Avant l'utilisation des satellites de télécommunication dans les années 1960, la communication radio par [http://fr.wikipedia.org/wiki/Haute_fr%C3%A9quence ondes courtes] était le seul moyen pour communiquer entre 2 points éloignés sur la Terre et elles sont toujours utilisés par les [http://fr.wikipedia.org/wiki/Radioamateur radio-amateurs].<br />
<br />
= Installer la [http://bit.ly/phd-ac Documentation Homebrew Preware (Preware Homebrew Documentation)] =<br />
<br />
Dans un monde post-webOS, vous aurez besoin d'avoir l'application Preware installé sur votre appareil. Le catalogue d'applications HP (HP App Catalog) ne sera plus disponible pour vous, donc vous avez besoin de récupérer la documentation dont vous avez besoin pour installer l'application Preware maintenant (Ndr : catalogue alternatif au catalogue d'applications HP).<br />
<br />
L'application [http://bit.ly/phd-ac Preware Homebrew Documentation (Documentation Homebrew Preware)] va vous guider pas à pas et de manière détaillé dans les différentes étapes à suivre des instructions d'installation.<br />
<br />
Ndt : Pour les francophones, l'installation de l'application "Documentation Homebrew Preware" peut-être optionnelle, par contre il existe des ressources en français pour cette installation de Preware qui sont : [http://www.webos-internals.org/wiki/Application:Preware-FR Preware à webos-internals.org] et [http://www.webosfrance.com/Video-Preware-Boostez-votre-terminal--Ajoutez-des-milliers-de-fonctionnalites-a-WebOS_a480.html Video installation Preware à webosfrance.com]<br />
<br />
= Installer l'application Preware =<br />
<br />
Suivez les instructions dans l'application [http://bit.ly/phd-ac Preware Homebrew Documentation (Documentation Homebrew Preware)] pour le faire. Ne tardez pas, vous devez déjà avoir installé Preware, pas après que HP et webOS s'en seront allés.<br />
<br />
Si vous avez des problèmes pour exécuter le logiciel "WebOS Quick Install" (surtout si vous êtes sur un ordinateur sous MS Windows), installez l'application [http://bit.ly/wosqi-guide WOSQI Homebrew Guide] et suivez le guide de dépannage qui est dedans.<br />
<br />
Ne vous reposez pas tant que vous n'aurez pas installé Preware et ensuite qu'il fonctionnera . Il est votre clé pour la distribution et l'installation d'applications dans un monde post-webOS.<br />
<br />
En suivant ces instructions, vous pourrez aussi vous retrouver avec le logiciel WebOS Quick Install installé et disponible sur votre ordinateur hôte. De multiples manières redondantes d'installer des choses sont des éléments clé dans un monde post-webOS.<br />
<br />
Ndt : Pour les francophones, les ressources en français pour cette installation de Preware sont : [http://www.webos-internals.org/wiki/Application:Preware-FR Preware à webos-internals.org] et [http://www.webosfrance.com/Video-Preware-Boostez-votre-terminal--Ajoutez-des-milliers-de-fonctionnalites-a-WebOS_a480.html Video installation Preware à webosfrance.com]<br />
<br />
= Vider votre profil =<br />
<br />
Les données contenues dans votre compte HP webOS (anciennement le profil Palm) (en ligne) ne seront plus disponibles pour vous dans un monde post-webOS.<br />
<br />
Déplacez les toutes ailleurs dès maintenant. Votre appareil webOS supporte un certain nombre de fournisseurs avec Synergy - choisissez en un avec qui vous êtes le plus l'aise et déplacer toutes vos données chez lui.<br />
<br />
Une des options possibles consiste à [[Backup your contacts to Gmail|Sauvegarder vos contacts dans Gmail(en anglais)]].<br />
<br />
= Installer l'application Save/Restore =<br />
<br />
Allez dans Preware. Recherchez l'application "Save/Restore" et installez l'application. Enregistrez les paramètres de vos/votre application(s).<br />
<br />
Si vous dépendez (comptez) sur une application qui n'est pas supportée par "Save/Restore", alors allez sur le [http://forums.precentral.net/webos-internals/237558-save-restore-community-development.html fil de discussion Save/Restore du forum] sur le site web webOS Nation et proposer de mettre en place une prime financière pour que les développeurs ajoutent le support de cette application.<br />
<br />
Assurez-vous bien que vous copiez le contenu du répertoire saverestore à partir de votre appareil webOS vers votre ordinateur hôte (ou un compte de stockage en ligne) régulièrement.<br />
<br />
Plus d'informations en français sur l'application "Save/Restore": [http://www.webos-internals.org/wiki/Application:SaveRestore-FR SaveRestore en français]<br />
<br />
= Sauvegarder vos paramètres (Tokens) =<br />
<br />
Installer l'application "Show Properties" à partir de Preware, et envoyez à vous-même un courriel contenant la liste '''Full(complète)''' des paramètres (utilisez l'option '''Full(complète)''' du menu, et non pas l'option '''Comms Board Swap (carte de communication embarqué ???)''' du menu).<br />
<br />
Ne vous inquiétez pas sur ce que cela signifie en ce moment, faites le tout simplement. Avec la liste des paramètres et le logiciel webOS Doctor vous pouvez faire revivre votre appareil ayant subi n'importe quelle calamité.<br />
<br />
= Téléchargez le logiciel webOS Doctor =<br />
<br />
Assurez-vous d'avoir la version correcte de webOS Doctor (version, type appareil, opérateur mobile) pour votre appareil et qui a été téléchargé sur les serveurs de HP et est disponible en local sur votre ordinateur hôte.<br />
<br />
Visitez notre page web [[WebOS_Doctor_Versions|webOS Doctor Versions]] et téléchargez la version correcte de webOS Doctor pour votre appareil dès maintenant.<br />
<br />
Dans un monde post-webOS, le logiciel webOS Doctor ne sera plus disponible sur les serveurs de HP, donc assurez vous bien d'avoir votre propre copie de webOS Doctor sauvegardée chez vous dès maintenant.<br />
<br />
= Etre prêt à travailler en ligne de commande =<br />
<br />
Pour pouvoir réaliser certaines mesures clé de survie, vous aurez besoin d'avoir un moyen d'accéder à l'interface en ligne de commande du système d'exploitation Linux de votre appareil.<br />
<br />
Les binaires des derniers pilotes Novacom peut être récupérés en bas de la page sur le site http://opensource.palm.com/packages.html. Dans un monde post-webOS, cette page ne sera plus accessible. Téléchargez dès à présent les pilotes pour les plates-formes (système d'exploitation) actuelles et futures de votre ordinateur hôte (PC, Mac, etc...) avant qu'ils ne disparaissent.<br />
<br />
Installez les pilotes et tester bien si votre ordinateur hôte reconnaît votre appareil/périphérique webOS lorsque vous le branchez à votre ordinateur.<br />
<br />
Entrainz-vous à savoir utiliser novaterm ou l'interface en ligne de commande de WOSQI (qui est une surcouche (wrapper) avec une interface graphique encapsulant ou au-dessus d'une connexion Novacom) pour accéder à l'interface en ligne de commande Linux de votre appareil.<br />
<br />
Le [http://bit.ly/wosqi-guide WOSQI Homebrew Guide (Guide Homebrew WOSQI)] contient un procédure visuelle sur la façon d'accéder à la ligne de commande sur votre appareil depuis un ordinateur hôte.<br />
<br />
Installez Xecutah pour accéder à la ligne de commande à partir de votre appareil.<br />
<br />
Beaucoup de techniques de survie post-webOS peuvent nécessiter des interactions/opérations en ligne de commande. Soyez prêt pour cela dès maintenant. Apprenez quelques techniques d' [[Basic Linux Use|Utilisation de base de Linux (en anglais)]] ou ici [http://wiki.linux-france.org/wiki/Les_commandes_fondamentales_de_Linux "Les commandes fondamentales de Linux" (en français)] avant qu'il ne soit trop tard.<br />
<br />
= Qu'est-propos de l'activation? =<br />
<br />
Il existe des techniques disponibles pour tous les appareils webOS pour contourner l'ensemble des pré-requis de l'activation pour l'opérateur de téléphonie mobile et pour HP/Palm. Nous pouvons prendre un tout nouveau appareil webOS qui n'a jamais été utilisé et le rendre pleinement fonctionnel sans avoir accès à tous les serveurs HP/Palm.<br />
Pour celà, il faut utiliser [http://www.webos-internals.org/wiki/Application:MetaDoctor-FR MetaDoctor]<br />
<br />
= Que faire concernant mes applications? =<br />
<br />
Lorsque le catalogue d'applications HP (HP App catalog) sera fermé, nous aurons besoin d'être en mesure de réinstaller les applications payantes que nous avons achetés sur les appareils pour lesquels ils ont été achetés.<br />
<br />
[http://bit.ly/webos-survival-kit WebOS Survival Kit(Le Kit de Survie webOS)] comprend tout ce dont vous avez besoin pour être prêt à suivre de nouvelles instructions afin de pouvoir le faire lorsque l'éventualité se présentera.<br />
<br />
Les outils requis pour reconditionner les applications afin de les ré-installer via Preware ont déjà été écrit et testé.<br />
<br />
Évidemment, puisque le catalogue des applications est toujours en fonctionnement, il n'est pas encore approprié de donner ces instructions.<br />
<br />
= Préparer tous les appareils webOS =<br />
<br />
Effectuer toutes les étapes ci-dessus pour chaque appareil webOS que vous possédez.<br />
<br />
= Acheter des batteries =<br />
<br />
Les batteries ne vont pas durer éternellement et elles cesseront d'être fabriquées dans un monde post-webOS. Assurez-vous d'en avoir un couple afin de pouvoir tenir le coup.<br />
<br />
Sur tous les appareils webOS autres que le TouchPad, il est possible de remplacer directement les batteries (votre garantie sera belle et bien expirée à cette date).<br />
<br />
Pour le TouchPad, [http://www.ifixit.com/Guide/Installing-HP-TouchPad-Battery/6082/1 ce n'est pas facile du tout]. Donc cette astuce ne s'applique uniquement qu'aux téléphones sous webOS.<br />
<br />
= Faire part de vos astuces =<br />
<br />
Abonnez-vous au [http://forums.precentral.net/webos-internals/303114-webos-survival-kit.html fil de discussion du forum correspondant] dans le [http://forums.precentral.net/webos-internals/ le forum WebOS Internals] et postez-y d'autres astuces pour leur ajout dans [http://bit.ly/webos-survival-kit Le Kit de Survie webOS] ou modifiez cette page du wiki directement.<br />
<br />
= Faire passer le mot =<br />
<br />
Assurez-vous que chaque utilisateur de webOS a l'adresse http://bit.ly/webos-survival-kit (l'URL officielle de cette page) mémorisé dans sa tête. Écrivez le sur un bout de papier, et coller le sur votre moniteur/écran. Ne l'oubliez jamais, vous finirez par en avoir besoin.<br />
<br />
= S'abonner aux forums =<br />
<br />
Il y a un certain nombre de forums de webOS avec de nombreux autres utilisateurs qui peuvent vous aider dans cette période de besoin.<br />
<br />
[http://www.webosnation.com WebOS Nation] est la principale source d'information de premier plan en anglais. Pouir ceux qui veulent consulter des articles de l'ancien site web webOSRoundup, allez sur l'archive de [https://web.archive.org/web/20120902001533/http://www.webosroundup.com/ webOSRoundup ICI].Ndt : Pour les francophones, et plus particulièrement la France, la principale source d'information est [http://www.webosfrance.com/ webOS France].<br />
<br />
= Faire un don =<br />
<br />
Les développeurs homebrew qui vous apportent ces outils reposent sur des dons pour pouvoir continuer à le faire.<br />
<br />
Internals WebOS: http://donate.webos-internals.org/<br />
<br />
Jason Robitaille: http://donate.canuckcoding.ca/<br />
<br />
= Ne paniquez pas =<br />
<br />
WebOS Internals et d'autres développeurs homebrew sont votre support (have your back). Ne paniquez pas.<br />
<br />
Vous serez en mesure d'utiliser votre appareil webOS aussi longtemps qu'il vous plaîra, même si tout le support et l'infrastructure de HP disparaît pendant une nuit.<br />
<br />
[http://farm3.static.flickr.com/2593/3892664015_e410aac714.jpg Nous sommes là pour vous.]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=WebOS_Survival_Kit-FR&diff=21967
WebOS Survival Kit-FR
2014-03-23T15:52:35Z
<p>Yannick56: /* Installer l'application Save/Restore */ sync with the english page</p>
<hr />
<div><br />
[[Category:French]]<br />
<br />
Cette page est disponible dans les 4 langues suivantes:<br />
:[[Image:Australia.png]] [[Image:USA.png]] [[WebOS_Survival_Kit|WebOSSurvival Kit]]<br />
:[[Image:France.png]] [[WebOS_Survival_Kit-FR| webOS Survival Kit (Kit de survie webOS)]]<br />
:[[Image:Germany.png]] [[WebOS_Survival_Kit-DE| webOS Survival Kit (Überlebensset)]]<br />
:[[image:Italy.png]] [[Kit_di_Sopravvivenza_webOS|Kit di Sopravvivenza webOS]]<br />
<br />
''Nous sommes en 2013. C'est un monde post-webOS.''<br />
<br />
''HP a vendu l'entité webOS, et l'acheteur l'a dépouillé de ces brevets, puis il a fermé toutes les infrastructures nécessaires pour supporter les appareils sous webOS.''<br />
<br />
''Les serveurs hébergeant le catalogue d'applications HP (HP App Catalog) et les profils Palm des utilisateurs ne peuvent plus être atteint (puisque hors service).''<br />
<br />
''Les comptes Twitter @palm et @webOSdev ne répond plus. Les forums des développeurs sont un désert aride.''<br />
<br />
''Certaines personnes choisissent la voie la plus facile et passent tout simplement à une autre plate-forme (fonctionnant sur un autre OS).''<br />
<br />
''D'autres apprennent à survivre, à l'aide du''... '''''Kit de survie webOS (webOS Survival Kit)'''''<br />
<br />
= Suivez le fil Twitter @webosinternals =<br />
<br />
Créez un compte Twitter et suivez le fil [http://twitter.com/webosinternals @webosinternals]. Pensez-le comme votre système d'alerte avancé et votre seul moyen de communication par radio à ondes courtes à longue distance. Lorsque le désastre arrivera, surveiller le pour y trouver de nouvelles instructions.<br />
<br />
Les autres principaux développeurs homebrew à suivre sont: [http://twitter.com/JayCanuck @JayCanuck] et [http://twitter.com/therealsconix @TheRealSconix]<br />
<br />
Ndt: Avant l'utilisation des satellites de télécommunication dans les années 1960, la communication radio par [http://fr.wikipedia.org/wiki/Haute_fr%C3%A9quence ondes courtes] était le seul moyen pour communiquer entre 2 points éloignés sur la Terre et elles sont toujours utilisés par les [http://fr.wikipedia.org/wiki/Radioamateur radio-amateurs].<br />
<br />
= Installer la [http://bit.ly/phd-ac Documentation Homebrew Preware (Preware Homebrew Documentation)] =<br />
<br />
Dans un monde post-webOS, vous aurez besoin d'avoir l'application Preware installé sur votre appareil. Le catalogue d'applications HP (HP App Catalog) ne sera plus disponible pour vous, donc vous avez besoin de récupérer la documentation dont vous avez besoin pour installer l'application Preware maintenant (Ndr : catalogue alternatif au catalogue d'applications HP).<br />
<br />
L'application [http://bit.ly/phd-ac Preware Homebrew Documentation (Documentation Homebrew Preware)] va vous guider pas à pas et de manière détaillé dans les différentes étapes à suivre des instructions d'installation.<br />
<br />
Ndt : Pour les francophones, l'installation de l'application "Documentation Homebrew Preware" peut-être optionnelle, par contre il existe des ressources en français pour cette installation de Preware qui sont : [http://www.webos-internals.org/wiki/Application:Preware-FR Preware à webos-internals.org] et [http://www.webosfrance.com/Video-Preware-Boostez-votre-terminal--Ajoutez-des-milliers-de-fonctionnalites-a-WebOS_a480.html Video installation Preware à webosfrance.com]<br />
<br />
= Installer l'application Preware =<br />
<br />
Suivez les instructions dans l'application [http://bit.ly/phd-ac Preware Homebrew Documentation (Documentation Homebrew Preware)] pour le faire. Ne tardez pas, vous devez déjà avoir installé Preware, pas après que HP et webOS s'en seront allés.<br />
<br />
Si vous avez des problèmes pour exécuter le logiciel "WebOS Quick Install" (surtout si vous êtes sur un ordinateur sous MS Windows), installez l'application [http://bit.ly/wosqi-guide WOSQI Homebrew Guide] et suivez le guide de dépannage qui est dedans.<br />
<br />
Ne vous reposez pas tant que vous n'aurez pas installé Preware et ensuite qu'il fonctionnera . Il est votre clé pour la distribution et l'installation d'applications dans un monde post-webOS.<br />
<br />
En suivant ces instructions, vous pourrez aussi vous retrouver avec le logiciel WebOS Quick Install installé et disponible sur votre ordinateur hôte. De multiples manières redondantes d'installer des choses sont des éléments clé dans un monde post-webOS.<br />
<br />
Ndt : Pour les francophones, les ressources en français pour cette installation de Preware sont : [http://www.webos-internals.org/wiki/Application:Preware-FR Preware à webos-internals.org] et [http://www.webosfrance.com/Video-Preware-Boostez-votre-terminal--Ajoutez-des-milliers-de-fonctionnalites-a-WebOS_a480.html Video installation Preware à webosfrance.com]<br />
<br />
= Vider votre profil =<br />
<br />
Les données contenues dans votre compte HP webOS (anciennement le profil Palm) (en ligne) ne seront plus disponibles pour vous dans un monde post-webOS.<br />
<br />
Déplacez les toutes ailleurs dès maintenant. Votre appareil webOS supporte un certain nombre de fournisseurs avec Synergy - choisissez en un avec qui vous êtes le plus l'aise et déplacer toutes vos données chez lui.<br />
<br />
Une des options possibles consiste à [[Backup your contacts to Gmail|Sauvegarder vos contacts dans Gmail(en anglais)]].<br />
<br />
= Installer l'application Save/Restore =<br />
<br />
Allez dans Preware. Recherchez l'application "Save/Restore" et installez l'application. Enregistrez les paramètres de vos/votre application(s).<br />
<br />
Si vous dépendez (comptez) sur une application qui n'est pas supportée par "Save/Restore", alors allez sur le [http://forums.precentral.net/webos-internals/237558-save-restore-community-development.html fil de discussion Save/Restore du forum] sur le site web webOS Nation et proposer de mettre en place une prime financière pour que les développeurs ajoutent le support de cette application.<br />
<br />
Assurez-vous bien que vous copiez le contenu du répertoire saverestore à partir de votre appareil webOS vers votre ordinateur hôte (ou un compte de stockage en ligne) régulièrement.<br />
<br />
Plus d'informations en français sur l'application "Save/Restore": [http://www.webos-internals.org/wiki/Application:SaveRestore-FR SaveRestore en français]<br />
<br />
= Sauvegarder vos paramètres (Tokens) =<br />
<br />
Installer l'application "Show Properties" à partir de Preware, et envoyez à vous-même un courriel contenant la liste '''Full(complète)''' des paramètres (utilisez l'option '''Full(complète)''' du menu, et non pas l'option '''Comms Board Swap (carte de communication embarqué ???)''' du menu).<br />
<br />
Ne vous inquiétez pas sur ce que cela signifie en ce moment, faites le tout simplement. Avec la liste des paramètres et le logiciel webOS Doctor vous pouvez faire revivre votre appareil ayant subi n'importe quelle calamité.<br />
<br />
= Téléchargez le logiciel webOS Doctor =<br />
<br />
Assurez-vous d'avoir la version correcte de webOS Doctor (version, type appareil, opérateur mobile) pour votre appareil et qui a été téléchargé sur les serveurs de HP et est disponible en local sur votre ordinateur hôte.<br />
<br />
Visitez notre page web [[WebOS_Doctor_Versions|webOS Doctor Versions]] et téléchargez la version correcte de webOS Doctor pour votre appareil dès maintenant.<br />
<br />
Dans un monde post-webOS, le logiciel webOS Doctor ne sera plus disponible sur les serveurs de HP, donc assurez vous bien d'avoir votre propre copie de webOS Doctor sauvegardée chez vous dès maintenant.<br />
<br />
= Etre prêt à travailler en ligne de commande =<br />
<br />
Pour pouvoir réaliser certaines mesures clé de survie, vous aurez besoin d'avoir un moyen d'accéder à l'interface en ligne de commande du système d'exploitation Linux de votre appareil.<br />
<br />
Les binaires des derniers pilotes Novacom peut être récupérés en bas de la page sur le site http://opensource.palm.com/packages.html. Dans un monde post-webOS, cette page ne sera plus accessible. Téléchargez dès à présent les pilotes pour les plates-formes (système d'exploitation) actuelles et futures de votre ordinateur hôte (PC, Mac, etc...) avant qu'ils ne disparaissent.<br />
<br />
Installez les pilotes et tester bien si votre ordinateur hôte reconnaît votre appareil/périphérique webOS lorsque vous le branchez à votre ordinateur.<br />
<br />
Entrainz-vous à savoir utiliser novaterm ou l'interface en ligne de commande de WOSQI (qui est une surcouche (wrapper) avec une interface graphique encapsulant ou au-dessus d'une connexion Novacom) pour accéder à l'interface en ligne de commande Linux de votre appareil.<br />
<br />
Le [http://bit.ly/wosqi-guide WOSQI Homebrew Guide (Guide Homebrew WOSQI)] contient un procédure visuelle sur la façon d'accéder à la ligne de commande sur votre appareil depuis un ordinateur hôte.<br />
<br />
Installez Xecutah pour accéder à la ligne de commande à partir de votre appareil.<br />
<br />
Beaucoup de techniques de survie post-webOS peuvent nécessiter des interactions/opérations en ligne de commande. Soyez prêt pour cela dès maintenant. Apprenez quelques techniques d' [[Basic Linux Use|Utilisation de base de Linux (en anglais)]] ou ici [http://wiki.linux-france.org/wiki/Les_commandes_fondamentales_de_Linux "Les commandes fondamentales de Linux" (en français)] avant qu'il ne soit trop tard.<br />
<br />
= Qu'est-propos de l'activation? =<br />
<br />
Il existe des techniques disponibles pour tous les appareils webOS pour contourner l'ensemble des pré-requis de l'activation pour l'opérateur de téléphonie mobile et pour HP/Palm. Nous pouvons prendre un tout nouveau appareil webOS qui n'a jamais été utilisé et le rendre pleinement fonctionnel sans avoir accès à tous les serveurs HP/Palm.<br />
Pour celà, il faut utiliser [http://www.webos-internals.org/wiki/Application:MetaDoctor-FR MetaDoctor]<br />
<br />
= Que faire concernant mes applications? =<br />
<br />
Lorsque le catalogue d'applications HP (HP App catalog) sera fermé, nous aurons besoin d'être en mesure de réinstaller les applications payantes que nous avons achetés sur les appareils pour lesquels ils ont été achetés.<br />
<br />
[http://bit.ly/webos-survival-kit WebOS Survival Kit(Le Kit de Survie webOS)] comprend tout ce dont vous avez besoin pour être prêt à suivre de nouvelles instructions afin de pouvoir le faire lorsque l'éventualité se présentera.<br />
<br />
Les outils requis pour reconditionner les applications afin de les ré-installer via Preware ont déjà été écrit et testé.<br />
<br />
Évidemment, puisque le catalogue des applications est toujours en fonctionnement, il n'est pas encore approprié de donner ces instructions.<br />
<br />
= Préparer tous les appareils webOS =<br />
<br />
Effectuer toutes les étapes ci-dessus pour chaque appareil webOS que vous possédez.<br />
<br />
= Acheter des batteries =<br />
<br />
Les batteries ne vont pas durer éternellement et elles cesseront d'être fabriquées dans un monde post-webOS. Assurez-vous d'en avoir un couple afin de pouvoir tenir le coup.<br />
<br />
Sur tous les appareils webOS autres que le TouchPad, il est possible de remplacer directement les batteries (votre garantie sera belle et bien expirée à cette date).<br />
<br />
Pour le TouchPad, [http://www.ifixit.com/Guide/Installing-HP-TouchPad-Battery/6082/1 ce n'est pas facile du tout]. Donc cette astuce ne s'applique uniquement qu'aux téléphones sous webOS.<br />
<br />
= Faire part de vos astuces =<br />
<br />
Abonnez-vous au [http://forums.precentral.net/webos-internals/303114-webos-survival-kit.html fil de discussion du forum correspondant] dans le [http://forums.precentral.net/webos-internals/ le forum WebOS Internals] et postez-y d'autres astuces pour leur ajout dans [http://bit.ly/webos-survival-kit Le Kit de Survie webOS] ou modifiez cette page du wiki directement.<br />
<br />
= Faire passer le mot =<br />
<br />
Assurez-vous que chaque utilisateur de webOS a l'adresse http://bit.ly/webos-survival-kit (l'URL officielle de cette page) mémorisé dans sa tête. Écrivez le sur un bout de papier, et coller le sur votre moniteur/écran. Ne l'oubliez jamais, vous finirez par en avoir besoin.<br />
<br />
= S'abonner aux forums =<br />
<br />
Il y a un certain nombre de forums de webOS avec de nombreux autres utilisateurs qui peuvent vous aider dans cette période de besoin.<br />
<br />
[http://www.precentral.net PreCentral] et [http://www.webosroundup.com webOSRoundup] sont deux des principales sources d'information de premier plan en anglais. Ndt : Pour les francophones, et plus particulièrement la France, la principale source d'information est [http://www.webosfrance.com/ webOS France].<br />
<br />
= Faire un don =<br />
<br />
Les développeurs homebrew qui vous apportent ces outils reposent sur des dons pour pouvoir continuer à le faire.<br />
<br />
Internals WebOS: http://donate.webos-internals.org/<br />
<br />
Jason Robitaille: http://donate.canuckcoding.ca/<br />
<br />
= Ne paniquez pas =<br />
<br />
WebOS Internals et d'autres développeurs homebrew sont votre support (have your back). Ne paniquez pas.<br />
<br />
Vous serez en mesure d'utiliser votre appareil webOS aussi longtemps qu'il vous plaîra, même si tout le support et l'infrastructure de HP disparaît pendant une nuit.<br />
<br />
[http://farm3.static.flickr.com/2593/3892664015_e410aac714.jpg Nous sommes là pour vous.]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21473
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-21T10:04:57Z
<p>Yannick56: /* Building Gnu Classpath 0.99-CVS */ add missing command line</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
Next install cvs needed for getting Gnu Classpath latest dev source code (0.99 in CVS)<br />
sudo apt-get install cvs<br />
<br />
Next install cvs needed for getting escher latest dev source code (1.9.90 in Hg)<br />
sudo apt-get install mercurial<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
rm -Rf /usr/local/*<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo rm -Rf /media/internal/*<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
=== Building escher 0.3 ===<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
=== Building escher 1.9.90 ===<br />
<br />
Escher source code : http://escher.hg.sourceforge.net:8000/hgroot/escher/escher and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
hg clone http://escher.hg.sourceforge.net:8000/hgroot/escher/escher escher-1.9.90<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-1.9.90<br />
edit build.xml and replace the line<br />
<property name="version" value="0.3" /><br />
by <br />
<property name="version" value="1.9.90" /><br />
.<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-1.9.90.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-1.9.90.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
=== Building Gnu Classpath 0.98 ===<br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
=== Building Gnu Classpath 0.99-CVS ===<br />
<br />
Patch for Gnu Classpath 0.99 with escher 1.9.90 : [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch]<br />
<br />
Compile :<br />
cd java-project<br />
<br />
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/classpath export -DNOW classpath<br />
mv classpath classpath-0.99<br />
<br />
Here, we need to patch classpath-0.99 because it can not compile with escher-1.9.90 but only with the old escher-0.2.3<br />
Go to [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch], and copy in a patch_escher-1.9.90_with_gnu-classpath-0.99.patch, all the lines from<br />
### Eclipse Workspace Patch 1.0 <br />
to<br />
ZPixmap getZPixmap()<br />
then next copy the patch_escher-1.9.90_with_gnu-classpath-0.99.patch file in classpath-0.99 folder<br />
$ cd classpath-0.99<br />
$ ./autogen.sh <br />
$ patch -p0 < patch_escher-1.9.90_with_gnu-classpath-0.99.patch<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Hunk #3 succeeded at 51 with fuzz 1.<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/GLGraphics.java.rej<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/KeyboardMapping.java.rej<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
4 out of 4 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/PixmapVolatileImage.java.rej<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
14 out of 14 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XEventPump.java.rej<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XFontPeer.java.rej<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/XFramePeer.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
12 out of 12 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphics2D.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsConfiguration.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] nn<br />
Skipping patch.<br />
5 out of 5 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsDevice.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsEnvironment.java.rej<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XImage.java.rej<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
7 out of 7 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XWindowPeer.java.rej<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/ZPixmapDataBuffer.java.rej<br />
-<br />
$ rm -Rf gnu/java/awt/peer/x/*.java.rej<br />
$ rm -Rf gnu/java/awt/peer/x/*.java.orig<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-1.9.90/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21471
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-21T09:58:58Z
<p>Yannick56: /* Building Gnu Classpath 0.99-CVS */ missing command line</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
Next install cvs needed for getting Gnu Classpath latest dev source code (0.99 in CVS)<br />
sudo apt-get install cvs<br />
<br />
Next install cvs needed for getting escher latest dev source code (1.9.90 in Hg)<br />
sudo apt-get install mercurial<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
rm -Rf /usr/local/*<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo rm -Rf /media/internal/*<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
=== Building escher 0.3 ===<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
=== Building escher 1.9.90 ===<br />
<br />
Escher source code : http://escher.hg.sourceforge.net:8000/hgroot/escher/escher and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
hg clone http://escher.hg.sourceforge.net:8000/hgroot/escher/escher escher-1.9.90<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-1.9.90<br />
edit build.xml and replace the line<br />
<property name="version" value="0.3" /><br />
by <br />
<property name="version" value="1.9.90" /><br />
.<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-1.9.90.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-1.9.90.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
=== Building Gnu Classpath 0.98 ===<br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
=== Building Gnu Classpath 0.99-CVS ===<br />
<br />
Patch for Gnu Classpath 0.99 with escher 1.9.90 : [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch]<br />
<br />
Compile :<br />
cd java-project<br />
<br />
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/classpath export -DNOW classpath<br />
mv classpath classpath-0.99<br />
<br />
Here, we need to patch classpath-0.99 because it can not compile with escher-1.9.90 but only with the old escher-0.2.3<br />
Go to [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch], and copy in a patch_escher-1.9.90_with_gnu-classpath-0.99.patch, all the lines from<br />
### Eclipse Workspace Patch 1.0 <br />
to<br />
ZPixmap getZPixmap()<br />
then next copy the patch_escher-1.9.90_with_gnu-classpath-0.99.patch file in classpath-0.99 folder<br />
$ cd classpath-0.99<br />
$ ./autogen.sh <br />
$ patch -p0 < patch_escher-1.9.90_with_gnu-classpath-0.99.patch<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Hunk #3 succeeded at 51 with fuzz 1.<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/GLGraphics.java.rej<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/KeyboardMapping.java.rej<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
4 out of 4 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/PixmapVolatileImage.java.rej<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
14 out of 14 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XEventPump.java.rej<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XFontPeer.java.rej<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/XFramePeer.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
12 out of 12 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphics2D.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsConfiguration.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] nn<br />
Skipping patch.<br />
5 out of 5 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsDevice.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsEnvironment.java.rej<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XImage.java.rej<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
7 out of 7 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XWindowPeer.java.rej<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/ZPixmapDataBuffer.java.rej<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-1.9.90/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21469
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-21T09:51:11Z
<p>Yannick56: /* Create the folders */ little improvement</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
Next install cvs needed for getting Gnu Classpath latest dev source code (0.99 in CVS)<br />
sudo apt-get install cvs<br />
<br />
Next install cvs needed for getting escher latest dev source code (1.9.90 in Hg)<br />
sudo apt-get install mercurial<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
rm -Rf /usr/local/*<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo rm -Rf /media/internal/*<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
=== Building escher 0.3 ===<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
=== Building escher 1.9.90 ===<br />
<br />
Escher source code : http://escher.hg.sourceforge.net:8000/hgroot/escher/escher and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
hg clone http://escher.hg.sourceforge.net:8000/hgroot/escher/escher escher-1.9.90<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-1.9.90<br />
edit build.xml and replace the line<br />
<property name="version" value="0.3" /><br />
by <br />
<property name="version" value="1.9.90" /><br />
.<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-1.9.90.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-1.9.90.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
=== Building Gnu Classpath 0.98 ===<br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
=== Building Gnu Classpath 0.99-CVS ===<br />
<br />
Patch for Gnu Classpath 0.99 with escher 1.9.90 : [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch]<br />
<br />
Compile :<br />
cd java-project<br />
<br />
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/classpath export -DNOW classpath<br />
mv classpath classpath-0.99<br />
<br />
Here, we need to patch classpath-0.99 because it can not compile with escher-1.9.90 but only with the old escher-0.2.3<br />
Go to [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch], and copy in a patch_escher-1.9.90_with_gnu-classpath-0.99.patch, all the lines from<br />
### Eclipse Workspace Patch 1.0 <br />
to<br />
ZPixmap getZPixmap()<br />
then next copy the patch_escher-1.9.90_with_gnu-classpath-0.99.patch file in classpath-0.99 folder<br />
$ cd classpath-0.99 <br />
$ patch -p0 < patch_escher-1.9.90_with_gnu-classpath-0.99.patch<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Hunk #3 succeeded at 51 with fuzz 1.<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/GLGraphics.java.rej<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/KeyboardMapping.java.rej<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
4 out of 4 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/PixmapVolatileImage.java.rej<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
14 out of 14 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XEventPump.java.rej<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XFontPeer.java.rej<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/XFramePeer.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
12 out of 12 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphics2D.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsConfiguration.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] nn<br />
Skipping patch.<br />
5 out of 5 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsDevice.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsEnvironment.java.rej<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XImage.java.rej<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
7 out of 7 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XWindowPeer.java.rej<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/ZPixmapDataBuffer.java.rej<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-1.9.90/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21447
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T21:07:59Z
<p>Yannick56: /* Building escher 1.9.90 */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
Next install cvs needed for getting Gnu Classpath latest dev source code (0.99 in CVS)<br />
sudo apt-get install cvs<br />
<br />
Next install cvs needed for getting escher latest dev source code (1.9.90 in Hg)<br />
sudo apt-get install mercurial<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
=== Building escher 0.3 ===<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
=== Building escher 1.9.90 ===<br />
<br />
Escher source code : http://escher.hg.sourceforge.net:8000/hgroot/escher/escher and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
hg clone http://escher.hg.sourceforge.net:8000/hgroot/escher/escher escher-1.9.90<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-1.9.90<br />
edit build.xml and replace the line<br />
<property name="version" value="0.3" /><br />
by <br />
<property name="version" value="1.9.90" /><br />
.<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-1.9.90.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-1.9.90.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
=== Building Gnu Classpath 0.98 ===<br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
=== Building Gnu Classpath 0.99-CVS ===<br />
<br />
Patch for Gnu Classpath 0.99 with escher 1.9.90 : [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch]<br />
<br />
Compile :<br />
cd java-project<br />
<br />
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/classpath export -DNOW classpath<br />
mv classpath classpath-0.99<br />
<br />
Here, we need to patch classpath-0.99 because it can not compile with escher-1.9.90 but only with the old escher-0.2.3<br />
Go to [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch], and copy in a patch_escher-1.9.90_with_gnu-classpath-0.99.patch, all the lines from<br />
### Eclipse Workspace Patch 1.0 <br />
to<br />
ZPixmap getZPixmap()<br />
then next copy the patch_escher-1.9.90_with_gnu-classpath-0.99.patch file in classpath-0.99 folder<br />
$ cd classpath-0.99 <br />
$ patch -p0 < patch_escher-1.9.90_with_gnu-classpath-0.99.patch<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Hunk #3 succeeded at 51 with fuzz 1.<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/GLGraphics.java.rej<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/KeyboardMapping.java.rej<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
4 out of 4 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/PixmapVolatileImage.java.rej<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
14 out of 14 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XEventPump.java.rej<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XFontPeer.java.rej<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/XFramePeer.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
12 out of 12 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphics2D.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsConfiguration.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] nn<br />
Skipping patch.<br />
5 out of 5 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsDevice.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsEnvironment.java.rej<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XImage.java.rej<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
7 out of 7 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XWindowPeer.java.rej<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/ZPixmapDataBuffer.java.rej<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-1.9.90/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21445
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T20:39:53Z
<p>Yannick56: /* Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) */ add Building escher 1.9.90</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
Next install cvs needed for getting Gnu Classpath latest dev source code (0.99 in CVS)<br />
sudo apt-get install cvs<br />
<br />
Next install cvs needed for getting escher latest dev source code (1.9.90 in Hg)<br />
sudo apt-get install mercurial<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
=== Building escher 0.3 ===<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
=== Building escher 1.9.90 ===<br />
<br />
Escher source code : http://escher.hg.sourceforge.net:8000/hgroot/escher/escher and http://escher.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
hg clone http://escher.hg.sourceforge.net:8000/hgroot/escher/escher escher-1.9.90<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-1.9.90<br />
edit build.xml and replace the line<br />
<property name="version" value="0.3" /><br />
by <br />
<property name="version" value="1.9.90" /><br />
<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-1.9.90.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-1.9.90.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
=== Building Gnu Classpath 0.98 ===<br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
=== Building Gnu Classpath 0.99-CVS ===<br />
<br />
Patch for Gnu Classpath 0.99 with escher 1.9.90 : [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch]<br />
<br />
Compile :<br />
cd java-project<br />
<br />
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/classpath export -DNOW classpath<br />
mv classpath classpath-0.99<br />
<br />
Here, we need to patch classpath-0.99 because it can not compile with escher-1.9.90 but only with the old escher-0.2.3<br />
Go to [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch], and copy in a patch_escher-1.9.90_with_gnu-classpath-0.99.patch, all the lines from<br />
### Eclipse Workspace Patch 1.0 <br />
to<br />
ZPixmap getZPixmap()<br />
then next copy the patch_escher-1.9.90_with_gnu-classpath-0.99.patch file in classpath-0.99 folder<br />
$ cd classpath-0.99 <br />
$ patch -p0 < patch_escher-1.9.90_with_gnu-classpath-0.99.patch<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Hunk #3 succeeded at 51 with fuzz 1.<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/GLGraphics.java.rej<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/KeyboardMapping.java.rej<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
4 out of 4 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/PixmapVolatileImage.java.rej<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
14 out of 14 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XEventPump.java.rej<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XFontPeer.java.rej<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/XFramePeer.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
12 out of 12 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphics2D.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsConfiguration.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] nn<br />
Skipping patch.<br />
5 out of 5 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsDevice.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsEnvironment.java.rej<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XImage.java.rej<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
7 out of 7 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XWindowPeer.java.rej<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/ZPixmapDataBuffer.java.rej<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-1.9.90/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21443
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T20:28:31Z
<p>Yannick56: /* Install GNU Classpath */ add building info for Gnu classpath 0.99</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
Next install cvs needed for getting Gnu Classpath latest dev source code (0.99 in CVS)<br />
sudo apt-get install cvs<br />
<br />
Next install cvs needed for getting escher latest dev source code (1.9.90 in Hg)<br />
sudo apt-get install mercurial<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
=== Building Gnu Classpath 0.98 ===<br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
=== Building Gnu Classpath 0.99-CVS ===<br />
<br />
Patch for Gnu Classpath 0.99 with escher 1.9.90 : [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch]<br />
<br />
Compile :<br />
cd java-project<br />
<br />
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/classpath export -DNOW classpath<br />
mv classpath classpath-0.99<br />
<br />
Here, we need to patch classpath-0.99 because it can not compile with escher-1.9.90 but only with the old escher-0.2.3<br />
Go to [http://old.nabble.com/XPeer-%28~Escher%29-patch-td29168966.html XPeer (~Escher) patch], and copy in a patch_escher-1.9.90_with_gnu-classpath-0.99.patch, all the lines from<br />
### Eclipse Workspace Patch 1.0 <br />
to<br />
ZPixmap getZPixmap()<br />
then next copy the patch_escher-1.9.90_with_gnu-classpath-0.99.patch file in classpath-0.99 folder<br />
$ cd classpath-0.99 <br />
$ patch -p0 < patch_escher-1.9.90_with_gnu-classpath-0.99.patch<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Hunk #3 succeeded at 51 with fuzz 1.<br />
patching file gnu/java/awt/peer/x/GLGraphics.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/GLGraphics.java.rej<br />
patching file gnu/java/awt/peer/x/KeyboardMapping.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/KeyboardMapping.java.rej<br />
patching file gnu/java/awt/peer/x/PixmapVolatileImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
4 out of 4 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/PixmapVolatileImage.java.rej<br />
patching file gnu/java/awt/peer/x/XEventPump.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
14 out of 14 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XEventPump.java.rej<br />
patching file gnu/java/awt/peer/x/XFontPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XFontPeer.java.rej<br />
patching file gnu/java/awt/peer/x/XFramePeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
1 out of 1 hunk ignored -- saving rejects to file gnu/java/awt/peer/x/XFramePeer.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphics2D.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
12 out of 12 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphics2D.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsConfiguration.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsConfiguration.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsDevice.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] nn<br />
Skipping patch.<br />
5 out of 5 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsDevice.java.rej<br />
patching file gnu/java/awt/peer/x/XGraphicsEnvironment.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XGraphicsEnvironment.java.rej<br />
patching file gnu/java/awt/peer/x/XImage.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
2 out of 2 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XImage.java.rej<br />
patching file gnu/java/awt/peer/x/XWindowPeer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
7 out of 7 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/XWindowPeer.java.rej<br />
patching file gnu/java/awt/peer/x/ZPixmapDataBuffer.java<br />
Reversed (or previously applied) patch detected! Assume -R? [n] n<br />
Apply anyway? [n] n<br />
Skipping patch.<br />
3 out of 3 hunks ignored -- saving rejects to file gnu/java/awt/peer/x/ZPixmapDataBuffer.java.rej<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-1.9.90/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-1.9.90/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21441
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T19:36:12Z
<p>Yannick56: /* Requirements */ improve</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
Next install cvs needed for getting Gnu Classpath latest dev source code (0.99 in CVS)<br />
sudo apt-get install cvs<br />
<br />
Next install cvs needed for getting escher latest dev source code (1.9.90 in Hg)<br />
sudo apt-get install mercurial<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21439
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T15:11:38Z
<p>Yannick56: /* OpenJDK */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html<br />
<br />
Simple Swing Tests with OpenJDK/Classpath/Classpath+Escher<br />
http://old.nabble.com/Simple-Swing-Tests-with-OpenJDK-Classpath-Classpath%2BEscher-td28605374.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21437
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T15:09:33Z
<p>Yannick56: /* Compiling and Running a HelloWorld Java Program */ fix</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -Xbootclasspath:/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm -Xbootclasspath:/media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21435
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T13:42:01Z
<p>Yannick56: /* Running */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX ([http://jblevins.org/notes/hostname SOURCE]): <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21433
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-16T12:57:04Z
<p>Yannick56: /* Running */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???] <BR><br />
THE FIX : <BR><br />
Check : <BR><br />
#hostname<br />
John KENNEDY - Palm Pre<br />
Modify :<br />
#hostname localhost<br />
Check : <BR><br />
#hostname<br />
localhost<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21431
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-15T12:08:58Z
<p>Yannick56: /* Links used to do the webOS port */ add more useful links</p>
<hr />
<div>= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
= Setting up your environment =<br />
<br />
* Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-mobile-project<br />
cd java-mobile-project<br />
<br />
* Get the phoneME Advanced source code :<br />
svn export https://svn.java.net/svn/phoneme~svn/builds/phoneme_advanced-mr2-dev-b167/ phoneme_advanced-mr2-dev-b167<br />
<br />
* Download and install Java 2 Platform, SE Development Kit 1.4.2_19 from http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase14-419411.html and copy it in the folder /home/ubuntu/java-mobile-project<br />
cd /home/ubuntu/java-mobile-project<br />
mv j2sdk-1_4_2_19-linux-i586.bin /home/ubuntu/java-mobile-project<br />
chmoad a+x j2sdk-1_4_2_19-linux-i586.bin<br />
./j2sdk-1_4_2_19-linux-i586.bin<br />
<br />
* Detailed instructions can be found at: http://web.archive.org/web/20070621032023/https://phoneme.dev.java.net/content/mr2/buildenv_feature.html<br />
<br />
* Create a file, /home/ubuntu/java-mobile-project/myenv.sh, on your host, then copy and paste the following into it. Then edit your paths appropriately (first 3 lines), followed by: host# source myenv.sh<br />
export MEHOME=/home/ubuntu/java-mobile-project/phoneme_advanced-mr2-dev-b167<br />
export JDK_DIR=/home/ubuntu/java-mobile-project/j2sdk1.4.2_19<br />
export SB2=/srv/preware/cross-compile/toolchain/arm-2009q1/arm-none-linux-gnueabi or /srv/preware/cross-compile/staging/mapping-armv7 ????<br />
export PATH=$PATH:$JDK_DIR/bin<br />
export BuildDir=$MEHOME/javacall-com/configuration/phoneMEFeature/win32_x86<br />
export JAVACALL_DIR=$MEHOME/javacall<br />
export JAVACALL_PROJECT_DIR=$MEHOME/javacall-com<br />
export JAVACALL_OUTPUT_DIR=$MEHOME/javacall-com<br />
export PCSL_OUTPUT_DIR=$MEHOME/output/pcsl<br />
export PCSL_PLATFORM=linux_arm_gcc<br />
export NETWORK_MODULE=bsd/generic<br />
export ENABLE_PCSL=true<br />
export ENABLE_ISOLATES=true<br />
export JVMWorkSpace=$MEHOME/cldc<br />
export JVMBuildSpace=$MEHOME/output/cldc<br />
export MIDP_OUTPUT_DIR=$MEHOME/output/midp<br />
export CLDC_DIST_DIR=$MEHOME/output/cldc/linux_arm/dist<br />
export TOOLS_DIR=$MEHOME/tools<br />
export TARGET_CPU=arm<br />
export USE_MULTIPLE_ISOLATES=true<br />
<br />
= Compiling phoneME Advanced for webOS =<br />
<br />
* Start by: host# cd phoneme_advanced-mr2-dev-b167/pcsl<br />
* To build PCSL: host# make NETWORK_MODULE=$NETWORK_MODULE PCSL_PLATFORM=$PCSL_PLATFORM GNU_TOOLS_DIR=$SB2<br />
* Then: host# cd phoneme_advanced-mr2-dev-b167/cldc/build/linux_arm<br />
* To build CLDC: host# make ENABLE_PCSL=$ENABLE_PCSL PCSL_OUTPUT_DIR=$PCSL_OUTPUT_DIR ENABLE_ISOLATES=$ENABLE_ISOLATES GNU_TOOLS_DIR=$SB2<br />
* Then: host# cd phoneme_advanced-mr2-dev-b167/midp/build/linux_fb_gcc<br />
* To build MIDP: host# make PCSL_OUTPUT_DIR=$PCSL_OUTPUT_DIR CLDC_DIST_DIR=$CLDC_DIST_DIR TOOLS_DIR=$TOOLS_DIR TARGET_CPU=$TARGET_CPU USE_MULTIPLE_ISOLATES=$USE_MULTIPLE_ISOLATES GNU_TOOLS_DIR=$SB2<br />
<br />
= Links used to do the webOS port =<br />
* [http://java.net/projects/phoneme/sources phoneME Advanced source code]<br />
* [http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]<br />
* [http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]<br />
* [http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]<br />
* [https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]<br />
* [http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]<br />
* [http://linux.omap.com/pipermail/davinci-linux-open-source/2008-June/007044.html arm-linux-gcc version on montavista 4.0.1 release]<br />
* [http://marcin.juszkiewicz.com.pl/2010/10/19/how-to-cross-compile-arm-kernel-under-ubuntu-10-10/ How to cross compile ARM kernel under Ubuntu 10.10]<br />
* [http://www.mobiledevmag.com/2010/10/developing-mobile-business-applications-with-java/ Developing Mobile Business Applications With Java]<br />
* [http://blog.sina.com.cn/s/blog_6b6170d10100koro.html How to build JavaCall for phoneme feature]<br />
* [http://blogs.oracle.com/wittyman/entry/building_jdbc_for_cdc_foundation Building JDBC for CDC/Foundation]<br />
* [http://hi.baidu.com/jakmax/blog/item/710fad0905d030b82fddd4bb.html build phoneME Advanced-MIDP]<br />
* [http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvanced Wiki phoneME Advanced with infos with several ports]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21423
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-14T16:36:14Z
<p>Yannick56: /* Setting up your environment */ add part Compiling phoneME Advanced for webOS</p>
<hr />
<div>= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
= Setting up your environment =<br />
<br />
* Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-mobile-project<br />
cd java-mobile-project<br />
<br />
* Get the phoneME Advanced source code :<br />
svn export https://svn.java.net/svn/phoneme~svn/builds/phoneme_advanced-mr2-dev-b167/ phoneme_advanced-mr2-dev-b167<br />
<br />
* Download and install Java 2 Platform, SE Development Kit 1.4.2_19 from http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase14-419411.html and copy it in the folder /home/ubuntu/java-mobile-project<br />
cd /home/ubuntu/java-mobile-project<br />
mv j2sdk-1_4_2_19-linux-i586.bin /home/ubuntu/java-mobile-project<br />
chmoad a+x j2sdk-1_4_2_19-linux-i586.bin<br />
./j2sdk-1_4_2_19-linux-i586.bin<br />
<br />
* Detailed instructions can be found at: http://web.archive.org/web/20070621032023/https://phoneme.dev.java.net/content/mr2/buildenv_feature.html<br />
<br />
* Create a file, /home/ubuntu/java-mobile-project/myenv.sh, on your host, then copy and paste the following into it. Then edit your paths appropriately (first 3 lines), followed by: host# source myenv.sh<br />
export MEHOME=/home/ubuntu/java-mobile-project/phoneme_advanced-mr2-dev-b167<br />
export JDK_DIR=/home/ubuntu/java-mobile-project/j2sdk1.4.2_19<br />
export SB2=/srv/preware/cross-compile/toolchain/arm-2009q1/arm-none-linux-gnueabi or /srv/preware/cross-compile/staging/mapping-armv7 ????<br />
export PATH=$PATH:$JDK_DIR/bin<br />
export BuildDir=$MEHOME/javacall-com/configuration/phoneMEFeature/win32_x86<br />
export JAVACALL_DIR=$MEHOME/javacall<br />
export JAVACALL_PROJECT_DIR=$MEHOME/javacall-com<br />
export JAVACALL_OUTPUT_DIR=$MEHOME/javacall-com<br />
export PCSL_OUTPUT_DIR=$MEHOME/output/pcsl<br />
export PCSL_PLATFORM=linux_arm_gcc<br />
export NETWORK_MODULE=bsd/generic<br />
export ENABLE_PCSL=true<br />
export ENABLE_ISOLATES=true<br />
export JVMWorkSpace=$MEHOME/cldc<br />
export JVMBuildSpace=$MEHOME/output/cldc<br />
export MIDP_OUTPUT_DIR=$MEHOME/output/midp<br />
export CLDC_DIST_DIR=$MEHOME/output/cldc/linux_arm/dist<br />
export TOOLS_DIR=$MEHOME/tools<br />
export TARGET_CPU=arm<br />
export USE_MULTIPLE_ISOLATES=true<br />
<br />
= Compiling phoneME Advanced for webOS =<br />
<br />
* Start by: host# cd phoneme_advanced-mr2-dev-b167/pcsl<br />
* To build PCSL: host# make NETWORK_MODULE=$NETWORK_MODULE PCSL_PLATFORM=$PCSL_PLATFORM GNU_TOOLS_DIR=$SB2<br />
* Then: host# cd phoneme_advanced-mr2-dev-b167/cldc/build/linux_arm<br />
* To build CLDC: host# make ENABLE_PCSL=$ENABLE_PCSL PCSL_OUTPUT_DIR=$PCSL_OUTPUT_DIR ENABLE_ISOLATES=$ENABLE_ISOLATES GNU_TOOLS_DIR=$SB2<br />
* Then: host# cd phoneme_advanced-mr2-dev-b167/midp/build/linux_fb_gcc<br />
* To build MIDP: host# make PCSL_OUTPUT_DIR=$PCSL_OUTPUT_DIR CLDC_DIST_DIR=$CLDC_DIST_DIR TOOLS_DIR=$TOOLS_DIR TARGET_CPU=$TARGET_CPU USE_MULTIPLE_ISOLATES=$USE_MULTIPLE_ISOLATES GNU_TOOLS_DIR=$SB2<br />
<br />
= Links used to do the webOS port =<br />
* [http://java.net/projects/phoneme/sources phoneME Advanced source code]<br />
* [http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]<br />
* [http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]<br />
* [http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]<br />
* [https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]<br />
* [http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21421
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-14T15:29:04Z
<p>Yannick56: update</p>
<hr />
<div>= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
= Setting up your environment =<br />
<br />
* Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-mobile-project<br />
cd java-mobile-project<br />
<br />
* Get the phoneME Advanced source code :<br />
svn export https://svn.java.net/svn/phoneme~svn/builds/phoneme_advanced-mr2-dev-b167/ phoneme_advanced-mr2-dev-b167<br />
* Download and install Java 2 Platform, SE Development Kit 1.4.2_19 from http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase14-419411.html<br />
* Detailed instructions can be found at: http://web.archive.org/web/20070621032023/https://phoneme.dev.java.net/content/mr2/buildenv_feature.html<br />
<br />
= Links used to do the webOS port =<br />
* [http://java.net/projects/phoneme/sources phoneME Advanced source code]<br />
* [http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]<br />
* [http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]<br />
* [http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]<br />
* [https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]<br />
* [http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21419
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-14T14:46:48Z
<p>Yannick56: /* Links used to do the webOS port */ add Requirements and Compiling parts</p>
<hr />
<div>= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-mobile-project<br />
cd java-mobile-project<br />
<br />
<br />
= Links used to do the webOS port =<br />
* [http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]<br />
* [http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]<br />
* [http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]<br />
* [https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]<br />
* [http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21417
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-14T14:43:32Z
<p>Yannick56: /* Links used to do the webOS port */</p>
<hr />
<div>= Links used to do the webOS port =<br />
* [http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]<br />
* [http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]<br />
* [http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]<br />
* [https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]<br />
* [http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21415
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-14T14:43:16Z
<p>Yannick56: /* Links used to do the webOS port */</p>
<hr />
<div>= Links used to do the webOS port =<br />
* [http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]<br />
* http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]<br />
* [http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]<br />
* [https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]<br />
* [http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21413
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-14T14:42:59Z
<p>Yannick56: /* Links used to do the webOS port */</p>
<hr />
<div>= Links used to do the webOS port =<br />
* [http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]<br />
* http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]]<br />
* [http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]<br />
* [https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]<br />
* [http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_phoneME_(for_Java_Mobile_-_J2ME_support_in_webOS)_with_scratchbox2&diff=21411
Building phoneME (for Java Mobile - J2ME support in webOS) with scratchbox2
2012-01-14T14:42:32Z
<p>Yannick56: create wiki page</p>
<hr />
<div>= Links used to do the webOS port =<br />
* [[http://www.slideshare.net/peterbuck/how-to-port-phoneme-advanced-software-to-google-android How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Online)]]<br />
* [[http://docs.huihoo.com/openmoko/TS-6304.pdf How to Port phoneME™ Advanced Software to Google Android, iPhone, OpenMoko, LiMO, and More (Download)]]<br />
* [[http://processors.wiki.ti.com/index.php/Java_ME Ti.com - phoneME Feature to run on DM355]] <br />
* [[https://docs.google.com/viewer?a=v&q=cache:tyeWgwFB_A0J:docs.oracle.com/javame/config/cldc/cldc-opt-impl/cldc-hi-2.0-web/doc/porting/pdf/CLDC-Hotspot-Port.pdf+j2me+phoneme+porting+pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESiW6f75Gk7nxO8SQKbSHg-_IS3jXPuPivIU04yWH6QnGKEANgwGZPpgp7ypxGJsrWlnlhcUQTaFWKRDAD_xgvrP_NyMDgF5jKkNsaU8X6TVsyvsLH5j2baog2qUpHrTNyyC0rt8&sig=AHIEtbSop5dcSJWOzT6qu8i5CbEf_8yKzQ CLDC HotSpot™ Implementation Porting Guide / CLDC HotSpot Implementation, Version 2.0]]<br />
* [[http://free-electrons.com/doc/embedded_linux_java.pdf Java in Embedded Linux Systems]]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Portal:Research&diff=21409
Portal:Research
2012-01-14T13:14:37Z
<p>Yannick56: add wiki link</p>
<hr />
<div>__notoc__<br />
{{portal-header|<br />
The Research Portal is for bleeding edge things being done with the device. <br />
<br />
Title all pages: '''Research [description]''' or '''Reference [description]'''<br />
}}<br />
{{portal-two-columns<br />
|column1=<br />
===Research:===<br />
<br />
* [[Android under webOS on Touchpad]]<br />
* [[Applications Bundled on the Pre]]<br />
* [[Application_Framework|Application Framework]]<br />
* [[Application Signing|Application Signing]]<br />
* [[Blocking Updates]]<br />
* [[New Bluetooth|BlueZ (Replacing Palm Bluetooth)]]<br />
* [[Bluetooth Network Connection]]<br />
* [[Boot_Chain|Boot Chain]]<br />
* [[Bootie]]<br />
* [[Carrier Configuration]]<br />
* [[ClassicFilesystem]]<br />
* [[Decrypt SSL (trusted man-in-the-middle technique)|Decrypt SSL (trusted man-in-the-middle technique)]]<br />
* [[Default packages available in several webOS release]]<br />
* [[Easter Eggs|Easter Eggs]]<br />
* [[FirstUse Application Functionality]]<br />
* [[Fonts available on board the Pre]]<br />
* [[Gstreamer]]<br />
* [[Hidd]]<br />
* [[Intercept_SSL_Traffic]]<br />
* [[Introspecting_Dbus|Introspecting Dbus]]<br />
* [[Java Support in webOS]]<br />
* [[Key Codes|Key Codes]] <br />
* [[Media API|Media API]]<br />
* [[Mounting Files and Devices as USB Mass Storage]]<br />
* [[Network Management|Network Management]]<br />
* [[Advanced Wifi|Advanced Wireless LAN]]<br />
* [[OmaDm|OmaDm research]]<br />
* [[OpenGL|OpenGL research]]<br />
* [[OpenGL_Triangle_of_Doom|OpenGL coding and demo Triangle of Doom]]<br />
* [[Pre Specific Hash Codes|Pre Specific Hash Codes]]<br />
* [[Research_Pre_Keyboard | Pre keyboard scancodes and keycodes]]<br />
* [[Palm_Profile_Interactions]]<br />
* [[Proximity Sensor]] <br />
* [[Pictures from Self-Test|Pictures from Self-Test]] <br />
* [[PmIpcDispatch|PmIpcDispatch to talk to palm IPC servers]]<br />
* [[Restore Debug Log|Restore Debug Log]] <br />
* [[Reverse_Engineering_WebOS_Doctor|Reverse Engineering WebOS Doctor]]<br />
* [[Rooted Pre Issues|Rooted Pre Issues]] <br />
* [[Resident_2x_Apps|Resident (Permanent) webOS 2.x applications under webOS 1.x]]<br />
* [[Research_Securing_Pre|Securing your Pre]]<br />
* [[Running Processes|Running Processes]] <br />
* [[Symlink Applications|Symlink Applications]] <br />
* [[System Sounds|System Sounds]] <br />
* [[TestApps|TestApps]] <br />
* [[Facebook timezone issue|The annoying Facebook timezone issue]]<br />
* [[Update Service Trace|Update Service Trace]] <br />
* [[USB Host Mode|USB Host Mode]]<br />
* [[Tidbits|Tidbits]] <br />
* [[VideoRecording]]<br />
* [[WebOS Exploration - Various Information|WebOS Exploration - Various Information]]<br />
* [[WebOS network configuration files]] <br />
* [[Research_Pre_GSM_Modem | Pre GSM modem device informations]]<br />
* [[Research_Pre_GSM_Modem_Protocol | Pre GSM modem protocol informations]]<br />
* [[Research_Pre_Audio | Audio routing and setup on the Pre]]<br />
* [[Research_mpt | MSM modem passthru mode ]]<br />
* [[Research_Pre_Boot_Process | Boot process]]<br />
* [[LibSDL Research| SDL LibSDL research which lead to Quake and Doom running]]<br />
* [[LibPDL Research| PDL LibPDL research ties into palm's device hooks]]<br />
* [[Unofficial networks compatiblity list]]<br />
* [[Research_kernel_Tuning | Research [kernel tuning]]]<br />
* [[Touchscreen]]<br />
* [[Chrooting | Methods of chrooting in webOS]]<br />
* [[Touchpad Bluetooth Keyboard]]<br />
* [[VPN Plugins]]<br />
* [[XApps Development | XApps development model]]<br />
<br />
|column2=<br />
===Reference===<br />
* [[Packaging Standards|Packaging Standards]]<br />
* [[webkit_transform|Webkit Transform]]- a powerful set of commands for manipulating elements.<br />
* [https://docs.google.com/viewer?a=v&q=cache:9lb_WwQBOXsJ:www.dunkelheit.com.br/supsi/Mobile/palestras/MFW10_JHU_PalmPrePhoneForensics.pdf+MFW10_JHU_PalmPrePhoneForensics.pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESgeMuyiewG_p88nJimTbMOKNerA-E1WtKgXfaajRXZ6PGmNd0YlWS3AyDpSqruZ9z71eUZdFQKgvUCKKTQC-hO8RXKbx7xU3iAfb1qv4e9Q2WuN1imFP0JDKKeCwAFjKbb1_L-i&sig=AHIEtbT_nc8wO7FY4HMi2wiN2nTpCZQfMQ webOS Forensics Using the Palm Pre Plus] : a lot of useful informations on webOS ([http://www.mobileforensicsworld.org/2010/presentations/MFW10_JHU_PalmPrePhoneForensics.pdf OLD LINK]).<br />
<br />
}}</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=WebOS_network_configuration_files&diff=21399
WebOS network configuration files
2012-01-13T17:45:56Z
<p>Yannick56: /* External links */</p>
<hr />
<div>= Configuration in files =<br />
<br />
Network configuration files from webOS 2.1.0 .<br />
<br />
By default, webOS use configuration from dnsmasq process<br />
<br />
<br />
* /etc/dnsmasq.palm.conf , in this file, only several parameters are enabled :<br />
<br />
# Never forward plain names (with a dot or domain part)<br />
domain-needed<br />
# Never forward addresses in the non-routed address spaces.<br />
bogus-priv<br />
...<br />
# Change this line if you want dns to get its upstream servers from<br />
# somewhere other that /etc/resolv.conf <br />
resolv-file=/tmp/resolv.conf<br />
...<br />
# By default, dnsmasq will send queries to any of the upstream<br />
# servers it knows about and tries to favour servers to are known<br />
# to be up. Uncommenting this forces dnsmasq to try each query<br />
# with each server strictly in the order they appear in<br />
# /etc/resolv.conf<br />
strict-order<br />
...<br />
# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv<br />
# files for changes and re-read them then uncomment this.<br />
no-poll<br />
...<br />
# If you want dnsmasq to listen for requests only on specified interfaces<br />
# (and the loopback) give the name of the interface (eg eth0) here. <br />
# Repeat the line for more than one interface.<br />
interface=lo <br />
interface=bridge0<br />
...<br />
# Include a another lot of configuration options.<br />
conf-file=/tmp/pmnetconfig/dnsmasq.server.conf<br />
<br />
* /etc/hosts.conf<br />
<br />
order hosts,bind<br />
multi on<br />
<br />
* /etc/hostname<br />
<br />
palm-webos<br />
<br />
* /etc/hosts<br />
<br />
127.0.0.1 localhost.localdomain localhost<br />
127.0.0.1 palm-webos<br />
<br />
<br />
* /etc/nss_mdns.conf<br />
<br />
# Default configuration file for nss_mdns<br />
# Applicable domains<br />
domain local<br />
domain 254.169.in-addr.arpa<br />
domain 8.e.f.ip6.int<br />
domain 9.e.f.ip6.int<br />
domain a.e.f.ip6.int<br />
domain b.e.f.ip6.int<br />
domain 8.e.f.ip6.arpa<br />
domain 9.e.f.ip6.arpa<br />
domain a.e.f.ip6.arpa<br />
domain b.e.f.ip6.arpa<br />
<br />
<br />
* /etc/nsswitch.conf<br />
<br />
# /etc/nsswitch.conf<br />
#<br />
# Example configuration of GNU Name Service Switch functionality.<br />
# If you have the `glibc-doc' and `info' packages installed, try:<br />
# `info libc "Name Service Switch"' for information about this file.<br />
passwd: compat<br />
group: compat<br />
shadow: compat<br />
hosts: files mdns dns<br />
networks: files<br />
protocols: db files<br />
services: db files<br />
ethers: db files<br />
rpc: db files<br />
netgroup: nis<br />
<br />
* /etc/PmWiFiDhclient.conf<br />
<br />
...<br />
request subnet-mask, broadcast-address, time-offset, routers,<br />
domain-name, domain-name-servers, host-name;<br />
...<br />
timeout 15;<br />
retry 30;<br />
reboot 10;<br />
initial-interval 1;<br />
script "/etc/PmWiFiDhclient-script";<br />
<br />
* /etc/resolv.conf : nothing<br />
<br />
<br />
* /etc/dhcp/dhclient.conf<br />
<br />
request subnet-mask, broadcast-address, time-offset, routers,<br />
domain-name, domain-name-servers, host-name,<br />
netbios-name-servers, netbios-scope;<br />
<br />
* /etc/network/interfaces<br />
<br />
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)<br />
# The loopback interface<br />
auto lo<br />
iface lo inet loopback<br />
# Wireless interfaces<br />
iface wlan0 inet dhcp<br />
wireless_mode managed<br />
wireless_essid any<br />
iface atml0 inet dhcp<br />
# Wired or wireless interfaces<br />
iface eth0 inet dhcp<br />
iface eth1 inet dhcp<br />
# Ethernet/RNDIS gadget (g_ether)<br />
# ... or on host side, usbnet and random hwaddr<br />
iface usb0 inet static<br />
address 192.168.0.202<br />
netmask 255.255.255.0<br />
network 192.168.0.0<br />
gateway 192.168.0.200 metric 40<br />
# Temporarily add support for old IP address<br />
# and automatically bring the interface up<br />
auto usb0:1<br />
iface usb0:1 inet static<br />
address 192.168.2.101<br />
netmask 255.255.255.0<br />
network 192.168.2.0<br />
# Bluetooth networking<br />
iface bnep0 inet dhcp<br />
<br />
* /etc/network/options<br />
<br />
ip_forward=no<br />
spoofprotect=yes<br />
syncookies=no<br />
<br />
= External links =<br />
<br />
* [http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html Linux Network Configuration]<br />
* [http://thekelleys.org.uk/dnsmasq/doc.html Dnsmasq]<br />
* [http://forums.hpwebos.com/t5/HP-TouchPad-Software-Hardware/Possible-quot-Web-Page-Not-Loading-quot-Fix-Need-Testers/td-p/366333 Howto update the file dhclient.conf]<br />
* [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 a way to assign a friendly host name (computer name) to the pre so I can use that to access it instead of an ip address]<br />
* [http://forums.webosnation.com/webos-development/199909-host-name-ip-putty-pre.html Host name (ip) in putty for Pre]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=WebOS_network_configuration_files&diff=21397
WebOS network configuration files
2012-01-13T17:45:34Z
<p>Yannick56: more links</p>
<hr />
<div>= Configuration in files =<br />
<br />
Network configuration files from webOS 2.1.0 .<br />
<br />
By default, webOS use configuration from dnsmasq process<br />
<br />
<br />
* /etc/dnsmasq.palm.conf , in this file, only several parameters are enabled :<br />
<br />
# Never forward plain names (with a dot or domain part)<br />
domain-needed<br />
# Never forward addresses in the non-routed address spaces.<br />
bogus-priv<br />
...<br />
# Change this line if you want dns to get its upstream servers from<br />
# somewhere other that /etc/resolv.conf <br />
resolv-file=/tmp/resolv.conf<br />
...<br />
# By default, dnsmasq will send queries to any of the upstream<br />
# servers it knows about and tries to favour servers to are known<br />
# to be up. Uncommenting this forces dnsmasq to try each query<br />
# with each server strictly in the order they appear in<br />
# /etc/resolv.conf<br />
strict-order<br />
...<br />
# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv<br />
# files for changes and re-read them then uncomment this.<br />
no-poll<br />
...<br />
# If you want dnsmasq to listen for requests only on specified interfaces<br />
# (and the loopback) give the name of the interface (eg eth0) here. <br />
# Repeat the line for more than one interface.<br />
interface=lo <br />
interface=bridge0<br />
...<br />
# Include a another lot of configuration options.<br />
conf-file=/tmp/pmnetconfig/dnsmasq.server.conf<br />
<br />
* /etc/hosts.conf<br />
<br />
order hosts,bind<br />
multi on<br />
<br />
* /etc/hostname<br />
<br />
palm-webos<br />
<br />
* /etc/hosts<br />
<br />
127.0.0.1 localhost.localdomain localhost<br />
127.0.0.1 palm-webos<br />
<br />
<br />
* /etc/nss_mdns.conf<br />
<br />
# Default configuration file for nss_mdns<br />
# Applicable domains<br />
domain local<br />
domain 254.169.in-addr.arpa<br />
domain 8.e.f.ip6.int<br />
domain 9.e.f.ip6.int<br />
domain a.e.f.ip6.int<br />
domain b.e.f.ip6.int<br />
domain 8.e.f.ip6.arpa<br />
domain 9.e.f.ip6.arpa<br />
domain a.e.f.ip6.arpa<br />
domain b.e.f.ip6.arpa<br />
<br />
<br />
* /etc/nsswitch.conf<br />
<br />
# /etc/nsswitch.conf<br />
#<br />
# Example configuration of GNU Name Service Switch functionality.<br />
# If you have the `glibc-doc' and `info' packages installed, try:<br />
# `info libc "Name Service Switch"' for information about this file.<br />
passwd: compat<br />
group: compat<br />
shadow: compat<br />
hosts: files mdns dns<br />
networks: files<br />
protocols: db files<br />
services: db files<br />
ethers: db files<br />
rpc: db files<br />
netgroup: nis<br />
<br />
* /etc/PmWiFiDhclient.conf<br />
<br />
...<br />
request subnet-mask, broadcast-address, time-offset, routers,<br />
domain-name, domain-name-servers, host-name;<br />
...<br />
timeout 15;<br />
retry 30;<br />
reboot 10;<br />
initial-interval 1;<br />
script "/etc/PmWiFiDhclient-script";<br />
<br />
* /etc/resolv.conf : nothing<br />
<br />
<br />
* /etc/dhcp/dhclient.conf<br />
<br />
request subnet-mask, broadcast-address, time-offset, routers,<br />
domain-name, domain-name-servers, host-name,<br />
netbios-name-servers, netbios-scope;<br />
<br />
* /etc/network/interfaces<br />
<br />
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)<br />
# The loopback interface<br />
auto lo<br />
iface lo inet loopback<br />
# Wireless interfaces<br />
iface wlan0 inet dhcp<br />
wireless_mode managed<br />
wireless_essid any<br />
iface atml0 inet dhcp<br />
# Wired or wireless interfaces<br />
iface eth0 inet dhcp<br />
iface eth1 inet dhcp<br />
# Ethernet/RNDIS gadget (g_ether)<br />
# ... or on host side, usbnet and random hwaddr<br />
iface usb0 inet static<br />
address 192.168.0.202<br />
netmask 255.255.255.0<br />
network 192.168.0.0<br />
gateway 192.168.0.200 metric 40<br />
# Temporarily add support for old IP address<br />
# and automatically bring the interface up<br />
auto usb0:1<br />
iface usb0:1 inet static<br />
address 192.168.2.101<br />
netmask 255.255.255.0<br />
network 192.168.2.0<br />
# Bluetooth networking<br />
iface bnep0 inet dhcp<br />
<br />
* /etc/network/options<br />
<br />
ip_forward=no<br />
spoofprotect=yes<br />
syncookies=no<br />
<br />
= External links =<br />
<br />
* [http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html Linux Network Configuration]<br />
* [http://thekelleys.org.uk/dnsmasq/doc.html Dnsmasq]<br />
* [http://forums.hpwebos.com/t5/HP-TouchPad-Software-Hardware/Possible-quot-Web-Page-Not-Loading-quot-Fix-Need-Testers/td-p/366333 Howto update the file dhclient.conf]<br />
* [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 a way to assign a friendly host name (computer name) to the pre so I can use that to access it instead of an ip address]<br />
* [ http://forums.webosnation.com/webos-development/199909-host-name-ip-putty-pre.html Host name (ip) in putty for Pre]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=WebOS_network_configuration_files&diff=21395
WebOS network configuration files
2012-01-13T17:38:18Z
<p>Yannick56: create wiki article</p>
<hr />
<div><br />
= Configuration in files =<br />
<br />
Network configuration files from webOS 2.1.0 .<br />
<br />
By default, webOS use configuration from dnsmasq process<br />
<br />
<br />
* /etc/dnsmasq.palm.conf , in this file, only several parameters are enabled :<br />
<br />
# Never forward plain names (with a dot or domain part)<br />
domain-needed<br />
# Never forward addresses in the non-routed address spaces.<br />
bogus-priv<br />
...<br />
# Change this line if you want dns to get its upstream servers from<br />
# somewhere other that /etc/resolv.conf <br />
resolv-file=/tmp/resolv.conf<br />
...<br />
# By default, dnsmasq will send queries to any of the upstream<br />
# servers it knows about and tries to favour servers to are known<br />
# to be up. Uncommenting this forces dnsmasq to try each query<br />
# with each server strictly in the order they appear in<br />
# /etc/resolv.conf<br />
strict-order<br />
...<br />
# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv<br />
# files for changes and re-read them then uncomment this.<br />
no-poll<br />
...<br />
# If you want dnsmasq to listen for requests only on specified interfaces<br />
# (and the loopback) give the name of the interface (eg eth0) here. <br />
# Repeat the line for more than one interface.<br />
interface=lo <br />
interface=bridge0<br />
...<br />
# Include a another lot of configuration options.<br />
conf-file=/tmp/pmnetconfig/dnsmasq.server.conf<br />
<br />
* /etc/hosts.conf<br />
<br />
order hosts,bind<br />
multi on<br />
<br />
* /etc/hostname<br />
<br />
palm-webos<br />
<br />
* /etc/hosts<br />
<br />
127.0.0.1 localhost.localdomain localhost<br />
127.0.0.1 palm-webos<br />
<br />
<br />
* /etc/nss_mdns.conf<br />
<br />
# Default configuration file for nss_mdns<br />
# Applicable domains<br />
domain local<br />
domain 254.169.in-addr.arpa<br />
domain 8.e.f.ip6.int<br />
domain 9.e.f.ip6.int<br />
domain a.e.f.ip6.int<br />
domain b.e.f.ip6.int<br />
domain 8.e.f.ip6.arpa<br />
domain 9.e.f.ip6.arpa<br />
domain a.e.f.ip6.arpa<br />
domain b.e.f.ip6.arpa<br />
<br />
<br />
* /etc/nsswitch.conf<br />
<br />
# /etc/nsswitch.conf<br />
#<br />
# Example configuration of GNU Name Service Switch functionality.<br />
# If you have the `glibc-doc' and `info' packages installed, try:<br />
# `info libc "Name Service Switch"' for information about this file.<br />
passwd: compat<br />
group: compat<br />
shadow: compat<br />
hosts: files mdns dns<br />
networks: files<br />
protocols: db files<br />
services: db files<br />
ethers: db files<br />
rpc: db files<br />
netgroup: nis<br />
<br />
* /etc/PmWiFiDhclient.conf<br />
<br />
...<br />
request subnet-mask, broadcast-address, time-offset, routers,<br />
domain-name, domain-name-servers, host-name;<br />
...<br />
timeout 15;<br />
retry 30;<br />
reboot 10;<br />
initial-interval 1;<br />
script "/etc/PmWiFiDhclient-script";<br />
<br />
* /etc/resolv.conf : nothing<br />
<br />
<br />
* /etc/dhcp/dhclient.conf<br />
<br />
request subnet-mask, broadcast-address, time-offset, routers,<br />
domain-name, domain-name-servers, host-name,<br />
netbios-name-servers, netbios-scope;<br />
<br />
* /etc/network/interfaces<br />
<br />
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)<br />
# The loopback interface<br />
auto lo<br />
iface lo inet loopback<br />
# Wireless interfaces<br />
iface wlan0 inet dhcp<br />
wireless_mode managed<br />
wireless_essid any<br />
iface atml0 inet dhcp<br />
# Wired or wireless interfaces<br />
iface eth0 inet dhcp<br />
iface eth1 inet dhcp<br />
# Ethernet/RNDIS gadget (g_ether)<br />
# ... or on host side, usbnet and random hwaddr<br />
iface usb0 inet static<br />
address 192.168.0.202<br />
netmask 255.255.255.0<br />
network 192.168.0.0<br />
gateway 192.168.0.200 metric 40<br />
# Temporarily add support for old IP address<br />
# and automatically bring the interface up<br />
auto usb0:1<br />
iface usb0:1 inet static<br />
address 192.168.2.101<br />
netmask 255.255.255.0<br />
network 192.168.2.0<br />
# Bluetooth networking<br />
iface bnep0 inet dhcp<br />
<br />
* /etc/network/options<br />
<br />
ip_forward=no<br />
spoofprotect=yes<br />
syncookies=no<br />
<br />
= External links =<br />
<br />
* [http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html Linux Network Configuration]<br />
* [http://thekelleys.org.uk/dnsmasq/doc.html Dnsmasq]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Portal:Research&diff=21393
Portal:Research
2012-01-13T10:47:00Z
<p>Yannick56: update link</p>
<hr />
<div>__notoc__<br />
{{portal-header|<br />
The Research Portal is for bleeding edge things being done with the device. <br />
<br />
Title all pages: '''Research [description]''' or '''Reference [description]'''<br />
}}<br />
{{portal-two-columns<br />
|column1=<br />
===Research:===<br />
<br />
* [[Android under webOS on Touchpad]]<br />
* [[Applications Bundled on the Pre]]<br />
* [[Application_Framework|Application Framework]]<br />
* [[Application Signing|Application Signing]]<br />
* [[Blocking Updates]]<br />
* [[New Bluetooth|BlueZ (Replacing Palm Bluetooth)]]<br />
* [[Bluetooth Network Connection]]<br />
* [[Boot_Chain|Boot Chain]]<br />
* [[Bootie]]<br />
* [[Carrier Configuration]]<br />
* [[ClassicFilesystem]]<br />
* [[Decrypt SSL (trusted man-in-the-middle technique)|Decrypt SSL (trusted man-in-the-middle technique)]]<br />
* [[Default packages available in several webOS release]]<br />
* [[Easter Eggs|Easter Eggs]]<br />
* [[FirstUse Application Functionality]]<br />
* [[Fonts available on board the Pre]]<br />
* [[Gstreamer]]<br />
* [[Hidd]]<br />
* [[Intercept_SSL_Traffic]]<br />
* [[Introspecting_Dbus|Introspecting Dbus]]<br />
* [[Java Support in webOS]]<br />
* [[Key Codes|Key Codes]] <br />
* [[Media API|Media API]]<br />
* [[Mounting Files and Devices as USB Mass Storage]]<br />
* [[Network Management|Network Management]]<br />
* [[Advanced Wifi|Advanced Wireless LAN]]<br />
* [[OmaDm|OmaDm research]]<br />
* [[OpenGL|OpenGL research]]<br />
* [[OpenGL_Triangle_of_Doom|OpenGL coding and demo Triangle of Doom]]<br />
* [[Pre Specific Hash Codes|Pre Specific Hash Codes]]<br />
* [[Research_Pre_Keyboard | Pre keyboard scancodes and keycodes]]<br />
* [[Palm_Profile_Interactions]]<br />
* [[Proximity Sensor]] <br />
* [[Pictures from Self-Test|Pictures from Self-Test]] <br />
* [[PmIpcDispatch|PmIpcDispatch to talk to palm IPC servers]]<br />
* [[Restore Debug Log|Restore Debug Log]] <br />
* [[Reverse_Engineering_WebOS_Doctor|Reverse Engineering WebOS Doctor]]<br />
* [[Rooted Pre Issues|Rooted Pre Issues]] <br />
* [[Resident_2x_Apps|Resident (Permanent) webOS 2.x applications under webOS 1.x]]<br />
* [[Research_Securing_Pre|Securing your Pre]]<br />
* [[Running Processes|Running Processes]] <br />
* [[Symlink Applications|Symlink Applications]] <br />
* [[System Sounds|System Sounds]] <br />
* [[TestApps|TestApps]] <br />
* [[Facebook timezone issue|The annoying Facebook timezone issue]]<br />
* [[Update Service Trace|Update Service Trace]] <br />
* [[USB Host Mode|USB Host Mode]]<br />
* [[Tidbits|Tidbits]] <br />
* [[VideoRecording]]<br />
* [[WebOS Exploration - Various Information|WebOS Exploration - Various Information]] <br />
* [[Research_Pre_GSM_Modem | Pre GSM modem device informations]]<br />
* [[Research_Pre_GSM_Modem_Protocol | Pre GSM modem protocol informations]]<br />
* [[Research_Pre_Audio | Audio routing and setup on the Pre]]<br />
* [[Research_mpt | MSM modem passthru mode ]]<br />
* [[Research_Pre_Boot_Process | Boot process]]<br />
* [[LibSDL Research| SDL LibSDL research which lead to Quake and Doom running]]<br />
* [[LibPDL Research| PDL LibPDL research ties into palm's device hooks]]<br />
* [[Unofficial networks compatiblity list]]<br />
* [[Research_kernel_Tuning | Research [kernel tuning]]]<br />
* [[Touchscreen]]<br />
* [[Chrooting | Methods of chrooting in webOS]]<br />
* [[Touchpad Bluetooth Keyboard]]<br />
* [[VPN Plugins]]<br />
* [[XApps Development | XApps development model]]<br />
<br />
|column2=<br />
===Reference===<br />
* [[Packaging Standards|Packaging Standards]]<br />
* [[webkit_transform|Webkit Transform]]- a powerful set of commands for manipulating elements.<br />
* [https://docs.google.com/viewer?a=v&q=cache:9lb_WwQBOXsJ:www.dunkelheit.com.br/supsi/Mobile/palestras/MFW10_JHU_PalmPrePhoneForensics.pdf+MFW10_JHU_PalmPrePhoneForensics.pdf&hl=fr&gl=fr&pid=bl&srcid=ADGEESgeMuyiewG_p88nJimTbMOKNerA-E1WtKgXfaajRXZ6PGmNd0YlWS3AyDpSqruZ9z71eUZdFQKgvUCKKTQC-hO8RXKbx7xU3iAfb1qv4e9Q2WuN1imFP0JDKKeCwAFjKbb1_L-i&sig=AHIEtbT_nc8wO7FY4HMi2wiN2nTpCZQfMQ webOS Forensics Using the Palm Pre Plus] : a lot of useful informations on webOS ([http://www.mobileforensicsworld.org/2010/presentations/MFW10_JHU_PalmPrePhoneForensics.pdf OLD LINK]).<br />
<br />
}}</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Portal:Research&diff=21391
Portal:Research
2012-01-13T10:43:19Z
<p>Yannick56: move link in the wiki article</p>
<hr />
<div>__notoc__<br />
{{portal-header|<br />
The Research Portal is for bleeding edge things being done with the device. <br />
<br />
Title all pages: '''Research [description]''' or '''Reference [description]'''<br />
}}<br />
{{portal-two-columns<br />
|column1=<br />
===Research:===<br />
<br />
* [[Android under webOS on Touchpad]]<br />
* [[Applications Bundled on the Pre]]<br />
* [[Application_Framework|Application Framework]]<br />
* [[Application Signing|Application Signing]]<br />
* [[Blocking Updates]]<br />
* [[New Bluetooth|BlueZ (Replacing Palm Bluetooth)]]<br />
* [[Bluetooth Network Connection]]<br />
* [[Boot_Chain|Boot Chain]]<br />
* [[Bootie]]<br />
* [[Carrier Configuration]]<br />
* [[ClassicFilesystem]]<br />
* [[Decrypt SSL (trusted man-in-the-middle technique)|Decrypt SSL (trusted man-in-the-middle technique)]]<br />
* [[Default packages available in several webOS release]]<br />
* [[Easter Eggs|Easter Eggs]]<br />
* [[FirstUse Application Functionality]]<br />
* [[Fonts available on board the Pre]]<br />
* [[Gstreamer]]<br />
* [[Hidd]]<br />
* [[Intercept_SSL_Traffic]]<br />
* [[Introspecting_Dbus|Introspecting Dbus]]<br />
* [[Java Support in webOS]]<br />
* [[Key Codes|Key Codes]] <br />
* [[Media API|Media API]]<br />
* [[Mounting Files and Devices as USB Mass Storage]]<br />
* [[Network Management|Network Management]]<br />
* [[Advanced Wifi|Advanced Wireless LAN]]<br />
* [[OmaDm|OmaDm research]]<br />
* [[OpenGL|OpenGL research]]<br />
* [[OpenGL_Triangle_of_Doom|OpenGL coding and demo Triangle of Doom]]<br />
* [[Pre Specific Hash Codes|Pre Specific Hash Codes]]<br />
* [[Research_Pre_Keyboard | Pre keyboard scancodes and keycodes]]<br />
* [[Palm_Profile_Interactions]]<br />
* [[Proximity Sensor]] <br />
* [[Pictures from Self-Test|Pictures from Self-Test]] <br />
* [[PmIpcDispatch|PmIpcDispatch to talk to palm IPC servers]]<br />
* [[Restore Debug Log|Restore Debug Log]] <br />
* [[Reverse_Engineering_WebOS_Doctor|Reverse Engineering WebOS Doctor]]<br />
* [[Rooted Pre Issues|Rooted Pre Issues]] <br />
* [[Resident_2x_Apps|Resident (Permanent) webOS 2.x applications under webOS 1.x]]<br />
* [[Research_Securing_Pre|Securing your Pre]]<br />
* [[Running Processes|Running Processes]] <br />
* [[Symlink Applications|Symlink Applications]] <br />
* [[System Sounds|System Sounds]] <br />
* [[TestApps|TestApps]] <br />
* [[Facebook timezone issue|The annoying Facebook timezone issue]]<br />
* [[Update Service Trace|Update Service Trace]] <br />
* [[USB Host Mode|USB Host Mode]]<br />
* [[Tidbits|Tidbits]] <br />
* [[VideoRecording]]<br />
* [[WebOS Exploration - Various Information|WebOS Exploration - Various Information]] <br />
* [[Research_Pre_GSM_Modem | Pre GSM modem device informations]]<br />
* [[Research_Pre_GSM_Modem_Protocol | Pre GSM modem protocol informations]]<br />
* [[Research_Pre_Audio | Audio routing and setup on the Pre]]<br />
* [[Research_mpt | MSM modem passthru mode ]]<br />
* [[Research_Pre_Boot_Process | Boot process]]<br />
* [[LibSDL Research| SDL LibSDL research which lead to Quake and Doom running]]<br />
* [[LibPDL Research| PDL LibPDL research ties into palm's device hooks]]<br />
* [[Unofficial networks compatiblity list]]<br />
* [[Research_kernel_Tuning | Research [kernel tuning]]]<br />
* [[Touchscreen]]<br />
* [[Chrooting | Methods of chrooting in webOS]]<br />
* [[Touchpad Bluetooth Keyboard]]<br />
* [[VPN Plugins]]<br />
* [[XApps Development | XApps development model]]<br />
<br />
|column2=<br />
===Reference===<br />
* [[Packaging Standards|Packaging Standards]]<br />
* [[webkit_transform|Webkit Transform]]- a powerful set of commands for manipulating elements.<br />
* [http://www.mobileforensicsworld.org/2010/presentations/MFW10_JHU_PalmPrePhoneForensics.pdf webOS Forensics Using the Palm Pre Plus] : a lot of useful informations on webOS.<br />
<br />
}}</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Portal:Research&diff=21389
Portal:Research
2012-01-13T10:42:22Z
<p>Yannick56: add Default packages available in several webOS release link</p>
<hr />
<div>__notoc__<br />
{{portal-header|<br />
The Research Portal is for bleeding edge things being done with the device. <br />
<br />
Title all pages: '''Research [description]''' or '''Reference [description]'''<br />
}}<br />
{{portal-two-columns<br />
|column1=<br />
===Research:===<br />
<br />
* [[Android under webOS on Touchpad]]<br />
* [[Applications Bundled on the Pre]]<br />
* [[Application_Framework|Application Framework]]<br />
* [[Application Signing|Application Signing]]<br />
* [[Blocking Updates]]<br />
* [[New Bluetooth|BlueZ (Replacing Palm Bluetooth)]]<br />
* [[Bluetooth Network Connection]]<br />
* [[Boot_Chain|Boot Chain]]<br />
* [[Bootie]]<br />
* [[Carrier Configuration]]<br />
* [[ClassicFilesystem]]<br />
* [[Decrypt SSL (trusted man-in-the-middle technique)|Decrypt SSL (trusted man-in-the-middle technique)]]<br />
* [[Default packages available in several webOS release]]<br />
* [[Easter Eggs|Easter Eggs]]<br />
* [[FirstUse Application Functionality]]<br />
* [[Fonts available on board the Pre]]<br />
* [[Gstreamer]]<br />
* [[Hidd]]<br />
* [[Intercept_SSL_Traffic]]<br />
* [[Introspecting_Dbus|Introspecting Dbus]]<br />
* [[Key Codes|Key Codes]] <br />
* [[Media API|Media API]]<br />
* [[Mounting Files and Devices as USB Mass Storage]]<br />
* [[Network Management|Network Management]]<br />
* [[Advanced Wifi|Advanced Wireless LAN]]<br />
* [[OmaDm|OmaDm research]]<br />
* [[OpenGL|OpenGL research]]<br />
* [[OpenGL_Triangle_of_Doom|OpenGL coding and demo Triangle of Doom]]<br />
* [[Pre Specific Hash Codes|Pre Specific Hash Codes]]<br />
* [[Research_Pre_Keyboard | Pre keyboard scancodes and keycodes]]<br />
* [[Palm_Profile_Interactions]]<br />
* [[Proximity Sensor]] <br />
* [[Pictures from Self-Test|Pictures from Self-Test]] <br />
* [[PmIpcDispatch|PmIpcDispatch to talk to palm IPC servers]]<br />
* [[Restore Debug Log|Restore Debug Log]] <br />
* [[Reverse_Engineering_WebOS_Doctor|Reverse Engineering WebOS Doctor]]<br />
* [[Rooted Pre Issues|Rooted Pre Issues]] <br />
* [[Resident_2x_Apps|Resident (Permanent) webOS 2.x applications under webOS 1.x]]<br />
* [[Research_Securing_Pre|Securing your Pre]]<br />
* [[Running Processes|Running Processes]] <br />
* [[Symlink Applications|Symlink Applications]] <br />
* [[System Sounds|System Sounds]] <br />
* [[TestApps|TestApps]] <br />
* [[Facebook timezone issue|The annoying Facebook timezone issue]]<br />
* [[Update Service Trace|Update Service Trace]] <br />
* [[USB Host Mode|USB Host Mode]]<br />
* [[Tidbits|Tidbits]] <br />
* [[VideoRecording]]<br />
* [[WebOS Exploration - Various Information|WebOS Exploration - Various Information]] <br />
* [[Research_Pre_GSM_Modem | Pre GSM modem device informations]]<br />
* [[Research_Pre_GSM_Modem_Protocol | Pre GSM modem protocol informations]]<br />
* [[Research_Pre_Audio | Audio routing and setup on the Pre]]<br />
* [[Research_mpt | MSM modem passthru mode ]]<br />
* [[Research_Pre_Boot_Process | Boot process]]<br />
* [[LibSDL Research| SDL LibSDL research which lead to Quake and Doom running]]<br />
* [[LibPDL Research| PDL LibPDL research ties into palm's device hooks]]<br />
* [[Unofficial networks compatiblity list]]<br />
* [[Research_kernel_Tuning | Research [kernel tuning]]]<br />
* [[Touchscreen]]<br />
* [[Java Support in webOS]]<br />
* [[Chrooting | Methods of chrooting in webOS]]<br />
* [[Touchpad Bluetooth Keyboard]]<br />
* [[VPN Plugins]]<br />
* [[XApps Development | XApps development model]]<br />
<br />
|column2=<br />
===Reference===<br />
* [[Packaging Standards|Packaging Standards]]<br />
* [[webkit_transform|Webkit Transform]]- a powerful set of commands for manipulating elements.<br />
* [http://www.mobileforensicsworld.org/2010/presentations/MFW10_JHU_PalmPrePhoneForensics.pdf webOS Forensics Using the Palm Pre Plus] : a lot of useful informations on webOS.<br />
<br />
}}</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21377
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-12T00:07:38Z
<p>Yannick56: /* Running */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost. [http://forums.webosnation.com/webos-development/186769-friendly-hostname-pre.html#post2483342 The fix ???]<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21375
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-12T00:03:35Z
<p>Yannick56: /* GUI mode */ impr</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
* You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
* You need to have an .Xauthority file on your webOS device (detailed steps on your Linux computer / not webOS device ) :<br />
mv .Xauthority .Xauthority.OLD<br />
mkxauth -c localhost<br />
mkxauth -c 127.0.0.1<br />
xauth list<br />
localhost/unix:0 MIT-MAGIC-COOKIE-1 02bab2e14519a798471b74a19a5557d6<br />
localhost:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
127.0.0.1/unix:0 MIT-MAGIC-COOKIE-1 055c66aab6ce789758499d026a8b236d<br />
mv .Xauthority .Xauthority.NEW<br />
mv .Xauthority.OLD .Xauthority<br />
Copy the .Xauthority.NEW file on your webOS device as USB drive <BR><br />
mv .Xauthority.NEW /media/internal<br />
cp -p .Xauthority.NEW /var/home/root/.Xauthority<br />
chown root:root /var/home/root/.Xauthority<br />
chmod 644 /var/home/root/.Xauthority<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
* Launch Xcecutah app, and launch Xterm in your Xcecutah app.<br />
* Check that the /var/home/root/.Xauthority file is created on your webOPS device. <br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
Common error :<br />
* <br />
java.net.ConnectException: Connection refused<br />
at gnu.java.nio.VMChannel.connect(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.NullPointerException<br />
at gnu.x11.Display.init_streams(Display.java:1177)<br />
...<br />
--> Xcetah and Xterm apps are not launched<br />
<br />
*<br />
Can't find Xauthority file: /home/root/.Xauthority<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
...<br />
--> The file /home/root/.Xauthority is not created<br />
<br />
*<br />
java.net.UnknownHostException: John KENNEDY - Palm Pre<br />
at java.net.VMInetAddress.getHostByName(Native Method)<br />
...<br />
at HelloWorld.main(HelloWorld.java:5)<br />
Exception in thread "main" java.lang.ClassCastException: [B<br />
at gnu.x11.Window.change_property(Window.java:742)<br />
--> Your webOS device use your name and the name of your webOS as host name. Need to change this name by localhost.<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21373
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-11T12:23:40Z
<p>Yannick56: /* Install GNU Classpath */ update for compiling with the good toolkit</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3b - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-qt-peer --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar <BR><br />
'''Note 3''' : Here, we have the option --enable-default-toolkit=gnu.java.awt.peer.x.XToolkit because if the parameter enable-default-toolkit is not set , it will use gnu.java.awt.peer.gtk.GtkToolkit by default (compile with GTK support) (Source part "dnl Default AWT toolkit" in [http://cvs.savannah.gnu.org/viewvc/classpath/configure.ac?revision=1.249&root=classpath&view=markup the file HERE]) .<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21371
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T16:48:21Z
<p>Yannick56: /* Running */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]) and in console type the command line xhost+ ([http://rbytes.net/linux/escher-review/ source]) .<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21369
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T16:46:42Z
<p>Yannick56: /* Jikes */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
or<br />
# /media/internal/opt/bin/jikes -version<br />
<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]).<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21367
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T16:46:10Z
<p>Yannick56: /* JamVM */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
or<br />
# /media/internal/opt/bin/jamvm -version<br />
<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]).<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21365
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T16:44:20Z
<p>Yannick56: /* Requirements for working */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
You need to install Xterm and [[Application:Xecutah|Xecutah]] applications and to REBOOT your webOS device.<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]).<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21363
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T16:43:39Z
<p>Yannick56: /* Running */ add more info</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
You need to install Xterm and [[Application:Xecutah|Xecutah]] applications.<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
To test X Awt peer, you must remove "-nolisten TCP" from XServer start script. ([http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 Source]).<br />
<br />
/usr/local/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
or <br />
/media/internal/opt/bin/jamvm HelloWorld -bootclasspath /media/internal/opt/share/jamvm/classes.zip:/media/internal/opt/share/classpath/glibj.zip:/media/internal/opt/share/classpath/escher-0.3.jar:/media/internal/opt/share/classpath/collections.jar HelloWorld -Dawt.toolkit=gnu.java.awt.peer.x.XToolkit HelloWorld<br />
<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21361
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T15:26:33Z
<p>Yannick56: /* GUI mode */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Requirements for working ===<br />
<br />
You need to install Xterm and [[Application:Xecutah|Xecutah]] applications.<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21359
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T14:45:19Z
<p>Yannick56: /* Installing the files on your device */ improve</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
*<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
or<br />
cd /media/internal<br />
sudo chown -R root:root *<br />
sudo tar cvf opt.tar opt<br />
copy the opt.tar on your webos device connected as USB key on your computer<br />
<br />
*<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
*<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
or<br />
<br />
cd /media/internal<br />
mv opt.tar /media/internal<br />
tar Pxvf opt.tar<br />
chmod -R 755 opt<br />
chown root:root opt<br />
<br />
Fix missing symbolic links (note symbolic links with ln -s are not possible in this file system/folder):<br />
cd /media/internal/opt/lib<br />
cp -p libjvm.so.0.0.0 libjvm.so<br />
cp -p libjvm.so.0.0.0 libjvm.so.0<br />
cp -p libffi.so.5.0.10 libffi.so.5.0<br />
cp -p libffi.so.5.0.10 libffi.so.5<br />
cp -p libffi.so.5.0.10 libffi.so<br />
cp -p /media/internal/opt/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
cp -p libjavaio.so.0.0.0 libjavaio.so<br />
cp -p libjavaio.so.0.0.0 libjavaio.so.0<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
cp -p libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
cp -p libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
cp -p libjavalang.so.0.0.0 libjavalang.so<br />
cp -p libjavalang.so.0.0.0 libjavalang.so.0<br />
cp -p libjavanet.so.0.0.0 libjavanet.so<br />
cp -p libjavanet.so.0.0.0 libjavanet.so.0<br />
cp -p libjavanio.so.0.0.0 libjavanio.so<br />
cp -p libjavanio.so.0.0.0 libjavanio.so.0<br />
cp -p libjavautil.so.0.0.0 libjavautil.so<br />
cp -p libjavautil.so.0.0.0 libjavautil.so.0<br />
cp -p libxmlj.so.0.0.0 libxmlj.so<br />
cp -p libxmlj.so.0.0.0 libxmlj.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21357
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T14:14:42Z
<p>Yannick56: /* Install Jikes */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
or<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/media/internal/opt<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21355
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T14:09:06Z
<p>Yannick56: /* Install JamVM */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21353
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T14:08:01Z
<p>Yannick56: /* Install JamVM */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/media/internal/opt/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib: /media/internal/opt/lib<br />
LDFLAGS="-L/usr/local/lib -L/media/internal/opt/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include -I/media/internal/opt/include" ./configure --prefix=/media/internal/opt --with-classpath-install-dir=/media/internal/opt -enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21351
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T14:03:53Z
<p>Yannick56: /* Install libffi needed by JamVM */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
or<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/media/internal/opt --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /media/internal/opt/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /media/internal/opt/include<br />
cp src/arm/ffitarget.h /media/internal/opt/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21349
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T14:01:01Z
<p>Yannick56: /* Install GNU Classpath */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - Without sound and With GUI and XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/media/internal/opt/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/media/internal/opt --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21347
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-10T11:54:10Z
<p>Yannick56: /* Install LibXML et LibXSLT needed to create xmlj.jar by Gnu Classpath (optionnal - only for XML parsing support as with web services) */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create libxmlj by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound ans XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=WebOS_Internals_PDK&diff=21341
WebOS Internals PDK
2012-01-09T11:17:29Z
<p>Yannick56: /* Start setup */ add more detailed info</p>
<hr />
<div>[[Category: SDL]]<br />
Palm's binary sdk the "Plugin Developer Kit" became available to all developers in March 2010.<br />
<br />
When the widk was developed, the Palm PDK didn't exist, and until Dec 2010, it was not possible to run the PDK in Linux. If you would like to run the official Palm PDK, see [[PDK on Linux]] for directions.<br />
<br />
In addition to the PDK, webOS Internals has released a full "WIDK" (webOS Internals Development Kit) for you using Scratchbox2. <br />
<br />
Less than 10% of developers in the webOS developer community use Linux variants. Among those 10% there are dozens of different linux distributions that people use. Palm, therefore has chosen to support only Mac and Windows platforms for their PDK. Palm recommends that Linux based developers use the webOS-internals WIDK instead. <br />
<br />
We ''strongly'' urge the open-source homebrew community to standardize on this WIDK. It uses the same underlying technologies, and is entirely open. <br />
<br />
Scratchbox 2 is a cross-compilation engine, it can be used to create a highly flexible SDK.<br />
<br />
As installed below, the install process uses a script which extracts the required Palm provided files from a copy of webOS doctor, and downloads from other sources, and builds a complete compilation environment automatically which can compile SDL and openGLES apps for webOS. <br />
<br />
SB2 ''itself'' is totally distribution neutral but the webOS cross-compile environment is designed and tested on Ubuntu Server 11.04 32 bit. See [[WebOS_Internals_PDK_on_Mandriva]] if you want to run it on Mandriva. If you want to run the WIDK on other distributions and are willing to support that yourself and not ask webOS Internals any questions about it then please enjoy and if you succeed come back here and make a new article on how you did it. Otherwise, use the recommended OS.<br />
<br />
The webOS Internals team ''strongly suggest'' apt-get install into the Ubuntu environment only for this purpose. The same installation of Sun Virtualbox which hosts the Palm SDK emulator can host an Ubuntu 11.04 server with very little effort on any operating system. <br />
<br />
Developers wanting to work in a Gentoo environment 'without' SB2 can consider using the [http://www.webos-internals.org/wiki/Gentoo_NDK PuffTheMagic NDK].<br />
<br />
== Installing Ubuntu ==<br />
<br />
You can download VirtualBox here : https://www.virtualbox.org/wiki/Downloads <BR><br />
You can download ISO files to burn Ubuntu CD or DVD here : http://www.ubuntu.com/download/ubuntu/download <BR><br />
but if you want to spend a litle time for installing Ubuntu in VirtualBox, then use Ubunbu image available here : http://virtualboxes.org/images/ubuntu/ <BR><br />
After installing your ubuntu image, don't forget to use bridge network configuration in Virtualbox. <br />
Then in the Ubuntu console, type : <br />
sudo apt-get install telnet ssh virtualbox-ose<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
In the Ubuntu desktop menu, go in System -> Preferences -> Keyboard -> Layouts tab to change the keyboard type.<br />
Then next reboot your ubuntu.<br />
<br />
==SB2 Homepage==<br />
[http://www.freedesktop.org/wiki/Software/sbox2 http://www.freedesktop.org/wiki/Software/sbox2]pdk<br />
<br />
==License==<br />
Scratchbox 2 is distributed under LGPL version 2.1, portions are under GPL version 2. Some minor stuff is under MIT style license.<br />
<br />
== Installation on Ubuntu for webOS PDK cross compiling ==<br />
<br />
If setting up in a Virtual Box instance, it is recommended that you first complete the openSSH config as described in the VirtualBox tips for Windows users to the right. This is helpful even with a Linux host, as SSH into the PDK Virtual Machine will allow copy and paste of the commands listed below and reduce errors.<br />
<br />
<br />
<div style="float:right; clear:right; width:30%">{{Ubuntu_VM_notes_for_Windows_users}}</div><br />
===Toolchain===<br />
<br />
===Prerequisites===<br />
Your Ubuntu installation will need the following installed. If you do not have them, run the command after the package name. You can test if they are found by just typing the command name. If it says command not found, you need to install it.<br />
<br />
{| border="1"<br />
|+ <br />
|'''git''' || sudo apt-get install git-core<br />
|-<br />
|'''gcc''' || sudo apt-get install build-essential<br />
|-<br />
|'''curl''' || sudo apt-get install curl<br />
|-<br />
|'''unzip'''|| sudo apt-get install unzip<br />
|-<br />
|'''7zip *'''|| sudo apt-get install p7zip-full<br />
|-<br />
|'''autoconf'''|| sudo apt-get install autoconf<br />
|-<br />
|'''subversion'''|| sudo apt-get install subversion<br />
|-<br />
|'''libtool'''|| sudo apt-get install libtool<br />
|-<br />
|'''wget'''|| sudo apt-get install wget<br />
|-<br />
|'''pkg-config'''|| sudo apt-get install pkg-config<br />
|-<br />
|'''gettext'''|| sudo apt-get install gettext<br />
|-<br />
|'''fakeroot'''|| sudo apt-get install fakeroot<br />
|-<br />
|'''javac *'''|| sudo apt-get install sun-java6-jdk (if this command line does not work, then do : sudo add-apt-repository ppa:ferramroberto/java; sudo apt-get update; sudo apt-get install sun-java6-jdk )<br />
|-<br />
|'''ant'''|| sudo apt-get install ant<br />
|-<br />
|'''cmake'''|| sudo apt-get install cmake<br />
|-<br />
|'''xsltproc'''|| sudo apt-get install xsltproc<br />
|-<br />
|'''intltool'''|| sudo apt-get install intltool<br />
|-<br />
|'''mkimage'''|| sudo apt-get install uboot-mkimage<br />
|-<br />
|'''lsdiff'''|| sudo apt-get install patchutils<br />
|-<br />
|'''flex'''|| sudo apt-get install flex<br />
|-<br />
|'''bison'''|| sudo apt-get install bison<br />
|-<br />
|'''libssl-dev'''|| sudo apt-get install libssl-dev<br />
|-<br />
|'''zlib1g-dev'''|| sudo apt-get install zlib1g-dev<br />
|-<br />
|'''libbz2-dev'''|| sudo apt-get install libbz2-dev<br />
|-<br />
|'''xar *'''|| sudo apt-get install xar<br />
|-<br />
|'''help2man'''|| sudo apt-get install help2man<br />
|-<br />
|'''texinfo'''|| sudo apt-get install texinfo<br />
|-<br />
|'''automake 1.10'''|| sudo apt-get install automake1.10<br />
|-<br />
|'''autopoint'''|| sudo apt-get install autopoint<br />
|-<br />
|'''xutils-dev'''|| sudo apt-get install xutils-dev<br />
|}<br />
<br />
* 7-Zip version 4.59 or greater is needed<br />
* it has been reported that sun-java6-jdk isn't necessary<br />
* On Ubuntu 11.04 xar might not install using <code>sudo apt-get install xar</code> See Note 2 Below<br />
<br />
If you're uncertain at all, and you're using Ubuntu 11.04, just cut and paste the following. If they are already installed, they'll be skipped. xar is not included in the code below.<br />
<br />
sudo apt-get install git-core build-essential curl unzip p7zip-full autoconf subversion libtool wget pkg-config gettext fakeroot ant xsltproc intltool uboot-mkimage patchutils flex bison libssl-dev zlib1g-dev libbz2-dev help2man texinfo automake1.10 autopoint xutils-dev cmake<br />
<br />
'''Note:''' If you are a beginner with Ubuntu Linux Distribution, you should update all the packages on your system to avoid problems when you will compile.<br />
<br />
'''Note 2:''' If <code>xar</code> cannot be installed with <code>sudo apt-get install xar</code>, then you have to download two <code>.deb</code>-files manually and install them (in the order they are listed):<br />
* If you're using Ubuntu 11.04:<br />
# [http://packages.ubuntu.com/hardy/libxar1 libxar1]<br />
# [http://packages.ubuntu.com/hardy/xar xar]<br />
* If you're using Debian 6.0.2 (Squeeze):<br />
# [http://packages.debian.org/lenny/libxar1 libxar1]<br />
# [http://packages.debian.org/lenny/xar xar]<br />
<br />
If you have not xar packages in your repo, then find the files in the previous links and next install manually xar files :<br />
sudo dpkg -i libxar1_1.5.1-1_i386.deb xar_1.5.1-1_i386.deb<br />
<br />
After that execute the above command again.<br />
<br />
Use these 2 command line :<BR><br />
Update repositories :<br />
sudo aptitude update (if it doesn't work use : sudo apt-get update )<br />
And next, update the packages :<br />
sudo aptitude safe-upgrade (if it doesn't work use : sudo apt-get upgrade )<br />
<br />
If you're on a 64-bit system, you will also need to install the ia32-libs package.<br />
<br />
'''Note:''' The ''make toolchain'' command and later steps will download approximately a half-gig of tools and sources from various locations. Do not start this if you do not have time for a large download. Additionally, if you already have downloaded a copy of the correct version of the WebOS doctor, you can reduce the download time by copying the doctor file into cross-compile/doctors/ with the correct name. This will cause the appropriate command to skip that download. Note that codesourcery rate limts downloads and at a minimum this process will take 10 to 15 minutes irrespective of your connection speed. <br />
<br />
====Start setup====<br />
Create a preware folder, copy the cross-compile tools into it (if you have not installed git, apt-get install git-core), and use a make script to begin the set up of the compilation toolchain. <br />
<br />
sudo mkdir -p /srv/preware<br />
cd /srv/preware<br />
sudo chmod 777 .<br />
git clone git://git.webos-internals.org/preware/cross-compile.git<br />
cd cross-compile<br />
make toolchain<br />
<br />
If errors occur, browse the [http://git.webos-internals.org/preware/cross-compile/ repository online] and checkout earlier commits until you get something that gets through "make toolchain" and the later "make stage" commands like so:<br />
<br />
git checkout <commit-ish><br />
or<br />
$ cd /srv/preware/cross-compile/<br />
$ ls -la<br />
drwxr-xr-x 8 ubuntu ubuntu 4096 2011-12-31 17:33 .git<br />
-rwxr-xr-x 1 ubuntu ubuntu 79 2011-12-31 17:33 .gitignore<br />
$ git branch<br />
* master<br />
$ git checkout master<br />
Already on 'master'<br />
$ git checkout<br />
$ ls -la<br />
drwxr-xr-x 8 ubuntu ubuntu 4096 2012-01-09 12:09 .git<br />
-rwxr-xr-x 1 ubuntu ubuntu 79 2011-12-31 17:33 .gitignore<br />
<br />
====Verify sh shell====<br />
On Ubuntu /bin/sh is a symbolic link to dash. This will cause errors with the make stage command below, as some of the scripts assume bash. Run the following command to see what shell sh is linked to.<br />
<br />
ls -l /bin/sh<br />
<br />
If the result is a link to dash:<br />
<br />
lrwxrwxrwx 1 root root 4 2010-07-06 23:55 /bin/sh -> dash<br />
<br />
You will want to correct it with the following:<br />
<br />
sudo dpkg-reconfigure dash<br />
<br />
You will be asked if you want to "Install dash as /bin/sh?". Select "<No>" and bash will be used. Rerun the command to verify:<br />
<br />
ls -l /bin/sh<br />
<br />
You should now see:<br />
<br />
lrwxrwxrwx 1 root root 4 2010-07-09 21:12 /bin/sh -> bash<br />
<br />
====Setup Scratchbox====<br />
Now, use apt-get to setup scratchbox...<br />
<br />
sudo apt-get install scratchbox2 qemu-kvm-extras (in Debian install qemu-user and qemu-system instead of qemu-kvm-extras)<br />
<br />
...and set it up for compiling for webOS. <br />
<br />
cd /srv/preware/cross-compile/toolchain/arm-2007q3/arm-none-linux-gnueabi/libc<br />
PATH=/srv/preware/cross-compile/toolchain/arm-2007q3/bin:${PATH} sb2-init -c /usr/bin/qemu-arm armv7 arm-none-linux-gnueabi-gcc<br />
PATH=/srv/preware/cross-compile/toolchain/arm-2007q3/bin:${PATH} sb2-init -c /usr/bin/qemu-arm armv6 arm-none-linux-gnueabi-gcc<br />
cd /srv/preware/cross-compile<br />
<br />
On some distributions such as recent Debian and Ubuntu, you'll have compiler problems with these values - use sb2-qemu-arm instead of qemu-arm in the sb2-init command lines above.<br />
<br />
Then:<br />
<br />
make setup<br />
<br />
Once this setup is complete, compiling sdl apps for webOS is very simple. Note that the set up for i686 is not yet determined.<br />
<br />
==Verified installed clean list==<br />
<br />
If you have successfully built the WIDK from scratch, with NO problems, feel free to add your information to this list. This will help us assess what distributions and versions it is fully compatible with.<br />
<br />
{| border="1" class="wikitable"<br />
|-<br />
|'''IRC name'''<br />
|'''Linux Distribution'''<br />
|'''Version'''<br />
|'''Date'''<br />
|'''Comments'''<br />
|-<br />
|Scoutcamper<br />
|Ubuntu<br />
|9.04,9.10,10.04,10.10<br />
|10-18-10<br />
|Works Great!<br />
|-<br />
|elpollodiablo1<br />
|Ubuntu<br />
|11.04<br />
|7-13-11<br />
|Works With updated Wiki Info<br />
|-<br />
|nebula<br />
|Ubuntu<br />
|11.04<br />
|9-7-11<br />
|It works!<br />
|-<br />
|yannick56<br />
|Ubuntu<br />
|11.04<br />
|12-31-11<br />
|Works With updated Wiki Info<br />
|}<br />
<br />
==Errors during make stage ==<br />
<br />
===automake1.10===<br />
<br />
If you see the error below, you need the latest automake (1.10)<br />
<br />
/usr/share/automake-1.9/am/depend2.am: am__fastdepOBJC does not appear in AM_CONDITIONAL<br />
configure.in:88: installing `./config.guess'<br />
configure.in:88: installing `./config.sub'<br />
Makefile.am: installing `./INSTALL'<br />
autoreconf2.50: automake failed with exit status: 1<br />
<br />
Install automake1.10 and it should work (according to [http://old.nabble.com/AC_PROG_OBJC-and-automake-1.9-td22434760.html this page])<br />
<br />
====Fix mmap errors====<br />
The following commands appear redundant. They are not. The install this fixes your mmap config to fix an mmap: permission denied error, but we don't need the package itself. (Do each command separately with cut and paste).<br />
<br />
sudo apt-get install qemu-arm-static<br />
sudo apt-get remove qemu-arm-static<br />
<br />
It appears that this package has been renamed qemu-kvm-extras-static in Ubuntu 11.04.<br />
<br />
: <span style="font-size:150%">OR</span> As a workaround, if this package is not available, <br />
::: the following commands can be executed in a root shell (sudo -s) to fix the mmap configuration to enable qemu-arm to work.<br />
<br />
echo "vm.mmap_min_addr = 4096" > /etc/sysctl.d/mmap_min_addr.conf<br />
/etc/init.d/procps restart<br />
<br />
(note that the value should not be "0". 4096 is chosen to avoid null pointer attacks.)<br />
<br />
<br />
===Libtool===<br />
<br />
make[5]: Entering directory `/srv/preware/cross-compile/packages/common/libdotconf/build/armv6/src'<br />
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -MT libdotconf_la-dotconf.lo -MD -MP -MF .deps/libdotconf_la-dotconf.Tpo -c -o libdotconf_la-dotconf.lo `test -f 'dotconf.c' || echo './'`dotconf.c<br />
libtool: Version mismatch error. This is libtool 2.2.6b, but the<br />
libtool: definition of this LT_INIT comes from libtool 2.2.6.<br />
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6b<br />
libtool: and run autoconf again.<br />
make[5]: *** [libdotconf_la-dotconf.lo] Error 63<br />
make[5]: Leaving directory `/srv/preware/cross-compile/packages/common/libdotconf/build/armv6/src'<br />
make[4]: *** [install-recursive] Error 1<br />
make[4]: Leaving directory `/srv/preware/cross-compile/packages/common/libdotconf/build/armv6'<br />
make[3]: *** [build/armv6.built] Error 2<br />
make[3]: Leaving directory `/srv/preware/cross-compile/packages/common/libdotconf'<br />
make[2]: *** [build_common/libdotconf] Error 2<br />
make[2]: Leaving directory `/srv/preware/cross-compile'<br />
make[1]: *** [staging-armv6] Error 2<br />
make[1]: Leaving directory `/srv/preware/cross-compile'<br />
make: *** [stage] Error 2<br />
<br />
Confirmed by 3 people. Fix this by either (your choice)<br />
*upgrading to Ubuntu 10.04 or newer (the WIDK now relies on a slightly newer version of libtool that's not in 9.10 or earlier)<br />
*updating libtool to 2.2.6b-2 (backported to 9.10, see available downloads on http://linuxappfinder.com/package/libtool#ubuntu_karmicpartner)<br />
<br />
<br />
If you're getting an error where sb2-init gives you the following output:<br />
<br />
checking for gcc... gcc<br />
checking for C compiler default output file name... a.out<br />
checking whether the C compiler works... configure: error: cannot run C compiled programs.<br />
If you meant to cross compile, use `--host'.<br />
See `config.log' for more details.<br />
<br />
<br />
Running /usr/bin/sb2-build-libtool failed<br />
You can run this manually later, otherwise your<br />
sb2 environment is correctly setup and ready to use<br />
<br />
You need to upgrade qemu. Alternatively, if your sb2-init output fails with a different output, like this:<br />
<br />
checking for gcc... gcc<br />
checking for C compiler default output file name... a.out<br />
checking whether the C compiler works... configure: error: cannot run C compiled programs.<br />
If you meant to cross compile, use `--host'.<br />
See `config.log' for more details.<br />
<br />
<br />
sb2-init completed successfully, have fun!<br />
<br />
Then you need to upgrade scratchbox, too (install 2.0 instead of 1.99).<br />
<br />
=== ecore ===<br />
*TRUE and FALSE are not defined:<br />
Manually add the definition:<br />
<br />
#ifndef TRUE<br />
# define TRUE 1<br />
#endif<br />
<br />
#ifndef FALSE<br />
# define FALSE 0<br />
#endif<br />
<br />
*<code>$po_makefile_in</code> could not be found:<br />
**Open the file <code>/srv/preware/cross-compile/packages/dev-e/ecore/build/src/configure.ac</code> and search for the line with: <code>$po_makefile_in</code> (in my case line 1437) and replace it with <code>po/Makefile.in</code><br />
<br />
=== /bin/sh errors ===<br />
If you are getting a "bad fd number" or other /bin/sh error, make sure your /bin/sh points to bash, not another shell (such as dash.)<br />
<br />
Go back through the Verify sh shell section above to correct.<br />
<br />
=== further download errors ===<br />
<br />
rwhitby's suggestion:<br />
<br />
If you don't need that package which is failing for you, just move it to the nonworking directory and try again.<br />
<br />
14 July 2011=Using Rod's approach: So far I had to move fuse, unionfs-fuse, dev-gl, voip and x (pango and pixman failed). Using Ubuntu 11.04.<br />
<br />
=== X--tag=CC: command not found ===<br />
<br />
While running '''make stage''' on Ubuntu 10.10, I got the following error during compilation of sdl-gfx:<br />
<br />
/bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"SDL_gfx\" -DVERSION=\"2.0.20\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DX_DISPLAY_MISSING=1 -DBUILD_DLL -I. -g -O2 -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -MT SDL_gfxPrimitives.lo -MD -MP -MF .deps/SDL_gfxPrimitives.Tpo -c -o SDL_gfxPrimitives.lo SDL_gfxPrimitives.c<br />
./libtool: line 847: X--tag=CC: command not found<br />
./libtool: line 880: libtool: ignoring unknown tag : command not found<br />
./libtool: line 847: X--mode=compile: command not found<br />
./libtool: line 1014: *** Warning: inferring the mode of operation is deprecated.: command not found<br />
./libtool: line 1015: *** Future versions of Libtool will require --mode=MODE be specified.: command not found<br />
./libtool: line 1158: Xgcc: command not found<br />
./libtool: line 1158: X-DPACKAGE_NAME="": command not found<br />
./libtool: line 1158: X-DPACKAGE_TARNAME="": command not found<br />
<br />
In order to fix this problem, I had to run this command to set <code>$echo</code> (which gets used in line 847 of the libtool script):<br />
<br />
export echo=echo<br />
<br />
and re-run <code>make stage</code> in the same shell session.<br />
<br />
=== missing macro AM_PATH_SDL in making libsdl-gfx ===<br />
In Ubuntu Server 11.04 amd64 I had to install the package libsdl1.2-dev to get past this. I also needed the X--tag=CC fix above.<br />
Also for Ubuntu 11.04 i386 install the package libsdl1.2-dev.<br />
<br />
=== virtualbox-ose missing ===<br />
<br />
I have the following error with Ubuntu 11.04 :<br />
...<br />
Extracting nova-cust-image-sdk1457.vmdk<br />
Everything is Ok<br />
Size: 397672448<br />
Compressed: 164460248<br />
VBoxManage clonehd rootfs/i686/extract/nova-cust-image-sdk1457.vmdk rootfs/i686/extract/nova-cust-image-sdk1457.raw --format RAW<br />
make: VBoxManage: Command not found<br />
make: *** [rootfs/i686/.unpacked] Error 127<br />
<br />
and I fix it by installing virtualbox-ose pakage as this :<br />
sudo apt-get install virtualbox-ose<br />
<br />
==Sample build of [[Application:Doom]]==<br />
<br />
Now, go to [[Building DOOM with scratchbox2]] and follow the simple directions.<br />
<br />
==In Process Enhancements==<br />
[[Extracting the PDK on Linux]]</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21339
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-08T22:43:53Z
<p>Yannick56: /* Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create xmlj.jar by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
or<br />
mkdir -p /media/internal/opt/share/classpath/<br />
cp dist/escher-0.3.jar /media/internal/opt/share/classpath/<br />
<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound ans XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21337
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-08T22:40:36Z
<p>Yannick56: /* Create the folders */</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
sudo mkdir -p /media/internal/opt<br />
sudo chown -R ubuntu:ubuntu /media<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create xmlj.jar by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound ans XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Building_JamVM_and_GNU_Classpath_and_Jikes_(for_Java_support_in_webOS)_with_scratchbox2&diff=21335
Building JamVM and GNU Classpath and Jikes (for Java support in webOS) with scratchbox2
2012-01-08T22:37:06Z
<p>Yannick56: /* Create the folders */ update for USB mode</p>
<hr />
<div><H3>''''NOTE : 02/01/2012 : Jikes, the Java compiler works and compile a basic HelloWorld java program with success,<BR> <br />
06/01/2012 : JamVM (JRE/Java runtime) works with a HelloWorld java program in text mode in a console !!! <BR><br />
Next steps : Have a Hello World java program with AWT GUI in a X window that works with JamVM JRE, and next have sound with JamVM JRE''''</H3><br />
<br />
= Requirements =<br />
<br />
First, follow the tutorial [[WebOS Internals PDK]] to set up the cross compilation environment.<br />
<br />
Next install gcj needed for compiling Gnu Classpath<br />
sudo apt-get install gcj<br />
<br />
= Compiling =<br />
<br />
Create your working folder :<br />
cd /home/ubuntu<br />
mkdir java-project<br />
cd java-project<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
== Create the folders ==<br />
<br />
mkdir -p /usr/local/bin/<br />
mkdir -p /usr/local/include/<br />
mkdir -p /usr/local/lib/<br />
mkdir -p /usr/local/share/<br />
or<br />
mkdir -p /media/internal/opt/bin/<br />
mkdir -p /media/internal/opt/include/<br />
mkdir -p /media/internal/opt/lib/<br />
mkdir -p /media/internal/opt/share/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Zlib needed by JamVM and LibXML2 ==<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
cd /srv/preware/cross-compile/packages/common<br />
rm -Rf /srv/preware/cross-compile/packages/common/zlib/build<br />
make -C zlib ARCH=armv7 stage<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install LibXML et LibXSLT needed to create xmlj.jar by Gnu Classpath (optionnal - only for XML parsing support as with web services) ==<br />
<br />
GNU Classpath 0.98 need libxml-2.0 >= 2.6.8 and libxslt >= 1.1.11 . Then we choose LibXML 2.6.26 and LibXSLT 1.1.17 with the same release date 06/06/2006<br />
<br />
'''Note : ''' Do not use LibXML 2.6.26 in /srv/preware/cross-compile/packages/common/libxml2 or http://git.webos-internals.org/preware/cross-compile/tree/packages/common/libxml2 <BR><br />
because the Makefile use install-pkgconfigDATA and make install in include folder (install only files in include and lib folders but not in bin folder). <BR><br />
The problem is that LibXSLT's configure want to find the file /usr/local/bin/xml2-config<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
LibXML 2.6.26 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxml2-2.6.26.tar.gz<br />
tar xzvf libxml2-2.6.26.tar.gz<br />
cd libxml2-2.6.26<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-zlib=/usr/local<br />
make <br />
make install<br />
cd ..<br />
<br />
LibXSLT 1.1.17 :<br />
cd /home/ubuntu/java-project<br />
wget ftp://xmlsoft.org/libxml2/old/libxslt-1.1.17.tar.gz<br />
tar xzvf libxslt-1.1.17.tar.gz<br />
cd libxslt-1.1.17<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-libxml-prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
== Install Alsa needed by Gnu Classpath (optionnal - only for GUI mode with sound) ==<br />
<br />
cd /srv/preware/cross-compile/packages/media<br />
rm -Rf /srv/preware/cross-compile/packages/media/alsa-lib/build<br />
make -C alsa-lib ARCH=armv7 stage<br />
<br />
== Install X needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
cd /srv/preware/cross-compile/packages/x<br />
rm -Rf /srv/preware/cross-compile/packages/x/libx11/build<br />
make -C libx11 ARCH=armv7 stage<br />
<br />
== Install Escher needed by Gnu Classpath (optionnal - only for GUI mode) ==<br />
<br />
Goal : bridge between Java and X server<br />
<br />
[http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ Escher useful information here].<br />
<br />
Escher download page : http://sourceforge.net/projects/escher/files/escher/0.3/ and http://escher.sourceforge.net/<br />
<br />
Ant download page : http://archive.apache.org/dist/ant/binaries/ and http://ant.apache.org/bindownload.cgi<br />
<br />
$ java -version<br />
java version "1.5.0"<br />
gij (GNU libgcj) version 4.5.2<br />
...<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://heanet.dl.sourceforge.net/project/escher/escher/0.3/escher-0.3.tar.gz<br />
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar xzvf escher-0.3.tar.gz<br />
tar xzvf apache-ant-1.7.1-bin.tar.gz<br />
export ANT_HOME=/home/ubuntu/java-project/apache-ant-1.7.1<br />
export PATH=$PATH:/home/ubuntu/java-project/apache-ant-1.7.1<br />
cd escher-0.3<br />
ant -f build.xml clean<br />
ant -f build.xml dist<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
mkdir -p /usr/local/share/classpath/<br />
cp dist/escher-0.3.jar /usr/local/share/classpath/<br />
<br />
Quit ScratchBox 2 :<br />
exit<br />
<br />
If you do not want to compile escher-0.3.jar, you can download [http://sourceforge.net/projects/escher/files/escher/0.3/ HERE], ready to use.<br />
<br />
== Install GNU Classpath ==<br />
<br />
Goal : implement almost all of the classes from Java J2SE 1.4 and 5.0. <br />
<br />
GNU Classpath at Wikipedia : http://en.wikipedia.org/wiki/GNU_Classpath<br />
<br />
GNU Classpath download page / website : http://www.gnu.org/software/classpath/downloads/downloads.html and http://www.gnu.org/software/classpath/<br />
<br />
'''Note''': here, Gnu Classpath is only compiled for working in console mode. No support for sound or GUI in Java programs. <br />
The extra libs needed for these supports are detailed here : http://www.gnu.org/software/classpath/docs/hacking.html#SEC5 <BR><br />
For compiling with sound support, ALSA libs are needed. For compiling with GUI support, X libs are needed AND Escher or QT or GTK libs. <BR><br />
For low footprint memory, Escher is the best choice. [http://marcosroriz.wordpress.com/2010/06/14/gsoc-updates/ More useful information here]. <BR><br />
<br />
Patch for Gnu Classpath 0.98 with escher 0.3.0 : [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41057 X Awt peers to escher lib broken]<br />
<br />
Compile :<br />
cd java-project<br />
wget ftp://ftp.gnu.org/gnu/classpath/classpath-0.98.tar.gz<br />
tar xzvf classpath-0.98.tar.gz<br />
<br />
Here, we need to patch classpath-0.98 because it can not compile with escher-0.3 but only the old escher-0.2.3<br />
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=18352<br />
mv "attachment.cgi?id=18352" patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
$ patch -p0 < patch_escher-0.3_with_gnu-classpath-0.98.patch<br />
patching file classpath-0.98/gnu/java/awt/peer/x/GLGraphics.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XEventPump.java<br />
patching file classpath-0.98/gnu/java/awt/peer/x/XGraphicsDevice.java<br />
<br />
cd classpath-0.98<br />
<br />
Go in ARM mode in your ScratchBox 2 :<br />
sb2 -M /srv/preware/cross-compile/staging/mapping-armv7<br />
<br />
Case 1 - Without GUI and sound support :<br />
./configure --prefix=/usr/local --disable-examples --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-alsa --disable-dssi<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 2 - With GUI and sound support :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections<br />
make<br />
make install<br />
cd ..<br />
<br />
Case 3 - With GUI and sound ans XMLJ support (XMLJ is used to parse XML files as web services, etc...) :<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --disable-examples --with-x --disable-gtk-peer --disable-gconf-peer --disable-plugin --enable-alsa --disable-dssi --with-escher=/home/ubuntu/java-project/escher-0.3/src --enable-local-sockets --enable-collections --enable-xmlj<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1''' : Here, we have the option --disable-plugin because the webkit web browser in webOS can use this java plugin. But maybe, this Java plugin can be used with [http://www.fractalbrew.com/labs/prefox/ PreFox web browser]. <BR><br />
'''Note 2''' : Here, we have the option --with-escher=/home/ubuntu/java-project/escher-0.3/src and NOT /usr/local/share/classpath because Gnu Classpath compile fine ONLY if he can find folder with the escher's java .class files and NOT the escher-0.3.jar<br />
<br />
== Install libffi needed by JamVM ==<br />
<br />
'''Note : You have segmentation fault with JamVM if you not compile it with [http://en.wikipedia.org/wiki/Libffi libffi].<br />
More info about this segmentation fault problem [http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/4015576 in this thread].'''<br />
<br />
libffi download page / website : http://sourceware.org/libffi/<br />
<br />
cd /home/ubuntu/java-project<br />
wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz<br />
tar xzvf libffi-3.0.10.tar.gz<br />
cd libffi-3.0.10<br />
./configure --prefix=/usr/local --with-gcc-arch=armv7<br />
make<br />
make install<br />
cp include/ffi_common.h /usr/local/include<br />
cp arm-unknown-linux-gnueabi/include/ffi.h /usr/local/include<br />
cp src/arm/ffitarget.h /usr/local/include<br />
cd ..<br />
<br />
== Install JamVM ==<br />
<br />
Goal : can launch Java program <br />
<br />
JamVM at Wikipedia : http://en.wikipedia.org/wiki/JamVM<br />
<br />
JamVM download page / website : http://sourceforge.net/projects/jamvm/files/jamvm/JamVM%201.5.4/ and http://jamvm.sourceforge.net/<br />
<br />
cd /home/ubuntu/java-project<br />
wget http://freefr.dl.sourceforge.net/project/jamvm/jamvm/JamVM%201.5.4/jamvm-1.5.4.tar.gz<br />
tar xzvf jamvm-1.5.4.tar.gz<br />
cd jamvm-1.5.4<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib<br />
export LD_RUN_LIBRARY_PATH=$LD_RUN_LIBRARY_PATH:/usr/local/lib<br />
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local --with-classpath-install-dir=/usr/local --enable-ffi<br />
make<br />
make install<br />
cd ..<br />
<br />
'''Note 1 : do not use CFLAGS parameter to compile JamVM, there is maybe a problem (segmentation fault) with this parameter as you can find it [http://old.nabble.com/Segmentation-Fault-in-JamVM1.5.4-%2B-Classpath-0.98-td27370619.html in this post].'''<br />
<br />
== Install Jikes ==<br />
<br />
Goal : can compile Java program <br />
<br />
Jikes at Wikipedia : http://en.wikipedia.org/wiki/Jikes<br />
<br />
download page / website : http://sourceforge.net/projects/jikes/files/ and http://jikes.sourceforge.net/<br />
<br />
wget http://freefr.dl.sourceforge.net/project/jikes/Jikes/1.22/jikes-1.22.tar.bz2<br />
bzip2 -d jikes-1.22.tar.bz2<br />
tar xvf jikes-1.22.tar<br />
cd jikes-1.22 <br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ..<br />
<br />
Quit Scratch Box : <br />
exit<br />
<br />
= Installing the files on your device =<br />
<br />
cd /srv/preware/cross-compile/staging/armv7/usr<br />
sudo chown -R root:root *<br />
sudo tar cvf local.tar *<br />
copy the local.tar on your webos device connected as USB key on your computer<br />
<br />
On your computer connect at your webOS device <br />
novacom -t open tty://<br />
<br />
Move the files in the good folders :<br />
cd /media/internal<br />
mkdir java-project<br />
mv local.tar java-project<br />
cd java-project<br />
tar Pxvf local.tar<br />
chmod -R 755 *<br />
chown root:root *<br />
cd bin<br />
cp -p * /usr/local/bin<br />
cp -p -r include lib man share /usr/local<br />
<br />
Fix missing symbolic links :<br />
cd /usr/local/lib<br />
ln -s libjvm.so.0.0.0 libjvm.so<br />
ln -s libjvm.so.0.0.0 libjvm.so.0<br />
ln -s libz.so.1.2.3 libz.so<br />
ln -s libz.so.1.2.3 libz.so.1<br />
ln -s libffi.so.5.0.10 libffi.so.5.0<br />
ln -s libffi.so.5.0.10 libffi.so.5<br />
ln -s libffi.so.5.0.10 libffi.so<br />
ln -s /usr/local/share/classpath/glibj.zip rt.jar<br />
cd classpath<br />
ln -s libjavaio.so.0.0.0 libjavaio.so<br />
ln -s libjavaio.so.0.0.0 libjavaio.so.0<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so<br />
ln -s libjavalangmanagement.so.0.0.0 libjavalangmanagement.so.0<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so<br />
ln -s libjavalangreflect.so.0.0.0 libjavalangreflect.so.0<br />
ln -s libjavalang.so.0.0.0 libjavalang.so<br />
ln -s libjavalang.so.0.0.0 libjavalang.so.0<br />
ln -s libjavanet.so.0.0.0 libjavanet.so<br />
ln -s libjavanet.so.0.0.0 libjavanet.so.0<br />
ln -s libjavanio.so.0.0.0 libjavanio.so<br />
ln -s libjavanio.so.0.0.0 libjavanio.so.0<br />
ln -s libjavautil.so.0.0.0 libjavautil.so<br />
ln -s libjavautil.so.0.0.0 libjavautil.so.0<br />
<br />
= Basic testing for the main binaries =<br />
<br />
== JamVM ==<br />
<br />
# /usr/local/bin/jamvm -version<br />
java version "1.5.0"<br />
JamVM version 1.5.4<br />
Copyright (C) 2003-2010 Robert Lougher <rob@jamvm.org.uk><br />
-<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU General Public License<br />
as published by the Free Software Foundation; either version 2,<br />
or (at your option) any later version.<br />
-<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
GNU General Public License for more details.<br />
-<br />
Build information:<br />
Execution Engine: inline-threaded interpreter with stack-caching<br />
Compiled with: gcc 4.2.1<br />
Boot Library Path: /usr/local/lib/classpath<br />
Boot Class Path: /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip<br />
<br />
== Jikes ==<br />
<br />
# /usr/local/bin/jikes -version<br />
Jikes Compiler - Version 1.22 - 3 October 2004<br />
Copyright (C) IBM Corporation 1997-2003, 2004.<br />
- Licensed Materials - Program Property of IBM - All Rights Reserved.<br />
Originally written by Philippe Charles and David Shields of IBM Research,<br />
Jikes is now maintained and refined by the Jikes Project at:<br />
<http://ibm.com/developerworks/opensource/jikes><br />
Please consult this URL for more information and for reporting problems.<br />
<br />
= Compiling and Running a HelloWorld Java Program =<br />
<br />
== console text mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi myfirstjavaprog.java <br />
and add the following lines in the myfirstjavaprog.java ([http://www.javacoffeebreak.com/java101/java101.html source]) :<br />
class myfirstjavaprog<br />
{ <br />
public static void main(String args[])<br />
{<br />
System.out.println("Hello World!");<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 myfirstjavaprog.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm myfirstjavaprog<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip myfirstjavaprog<br />
and you can see :<br />
Hello World!<br />
<br />
== GUI mode ==<br />
<br />
=== Compiling ===<br />
<br />
For this example, I use a novacom connexion on my Palm Pre.<br />
cd /media/internal<br />
vi HelloWorld.java <br />
and add the following lines in the HelloWorld.java ([http://www.xinotes.org/notes/note/1105/ source]) :<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
public class HelloWorld extends Frame {<br />
public static void main (String [] argv){<br />
HelloWorld h = new HelloWorld();<br />
}<br />
public HelloWorld(){<br />
setTitle("Hello World!");<br />
setSize(150, 125);<br />
Panel hello = new Panel();<br />
add("Center", hello);<br />
Button button = new Button("OK");<br />
add("South", button);<br />
button.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
System.exit(0);<br />
}<br />
});<br />
setVisible(true);<br />
int width = hello.getWidth();<br />
int height = hello.getHeight();<br />
Graphics g = hello.getGraphics();<br />
g.drawString("Hello World!", width/2 - 25, height/2);<br />
addWindowListener(new WindowAdapter(){<br />
public void windowClosing(WindowEvent e){ <br />
System.exit(0);<br />
}<br />
});<br />
}<br />
}<br />
<br />
Compile :<br />
# /usr/local/bin/jikes -bootclasspath /usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld.java<br />
ls -l <br />
...<br />
-rwxrwxrwx 1 root root 440 Jan 2 14:38 HelloWorld.class<br />
...<br />
<br />
=== Running ===<br />
<br />
/usr/local/bin/jamvm HelloWorld<br />
or <br />
/usr/local/bin/jamvm -client -classpath/usr/local/share/jamvm/classes.zip:/usr/local/share/classpath/glibj.zip HelloWorld<br />
and you can see a GUI window :<br />
Hello World!<br />
<br />
== Audio mode ==<br />
[http://rbwhitaker.wikidot.com/java-play-audio Playing Audio in Java]<br />
<br />
= Files installed by each program =<br />
<br />
== Gnu Classpath ==<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/bin<br />
total 52<br />
-rwxr-xr-x 1 ubuntu ubuntu 2073 2012-01-01 19:23 gappletviewer<br />
-rwxr-xr-x 1 ubuntu ubuntu 2058 2012-01-01 19:23 gjar<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gjarsigner<br />
-rwxr-xr-x 1 ubuntu ubuntu 2062 2012-01-01 19:23 gjavah<br />
-rwxr-xr-x 1 ubuntu ubuntu 2113 2012-01-01 19:23 gjdoc<br />
-rwxr-xr-x 1 ubuntu ubuntu 2066 2012-01-01 19:23 gkeytool<br />
-rwxr-xr-x 1 ubuntu ubuntu 2084 2012-01-01 19:23 gnative2ascii<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 gorbd<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmic<br />
-rwxr-xr-x 1 ubuntu ubuntu 2060 2012-01-01 19:23 grmid<br />
-rwxr-xr-x 1 ubuntu ubuntu 2074 2012-01-01 19:23 grmiregistry<br />
-rwxr-xr-x 1 ubuntu ubuntu 2075 2012-01-01 19:23 gserialver<br />
-rwxr-xr-x 1 ubuntu ubuntu 2070 2012-01-01 19:23 gtnameserv<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/include<br />
total 80<br />
-rw-r--r-- 1 ubuntu ubuntu 3516 2012-01-01 19:23 jawt.h<br />
-rw-r--r-- 1 ubuntu ubuntu 2349 2012-01-01 19:23 jawt_md.h<br />
-rw-r--r-- 1 ubuntu ubuntu 66655 2012-01-01 19:23 jni.h<br />
-rw-r--r-- 1 ubuntu ubuntu 1547 2012-01-01 19:23 jni_md.h<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
-rw-r--r-- 1 ubuntu ubuntu 1437 2012-01-01 19:23 logging.properties<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 security<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/classpath <br />
total 1228<br />
-rwxr-xr-x 1 ubuntu ubuntu 806 2012-01-01 19:23 libjavaio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so -> libjavaio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 18 2012-01-01 19:23 libjavaio.so.0 -> libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 177244 2012-01-01 19:23 libjavaio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavalang.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 878 2012-01-01 19:23 libjavalangmanagement.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so -> libjavalangmanagement.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 30 2012-01-01 19:23 libjavalangmanagement.so.0 -> libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 25052 2012-01-01 19:23 libjavalangmanagement.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 860 2012-01-01 19:23 libjavalangreflect.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so -> libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 27 2012-01-01 19:23 libjavalangreflect.so.0 -> libjavalangreflect.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 24773 2012-01-01 19:23 libjavalangreflect.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so -> libjavalang.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavalang.so.0 -> libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 378668 2012-01-01 19:23 libjavalang.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanet.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so -> libjavanet.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanet.so.0 -> libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 263348 2012-01-01 19:23 libjavanet.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 812 2012-01-01 19:23 libjavanio.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so -> libjavanio.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 19 2012-01-01 19:23 libjavanio.so.0 -> libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 311502 2012-01-01 19:23 libjavanio.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 818 2012-01-01 19:23 libjavautil.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so -> libjavautil.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 20 2012-01-01 19:23 libjavautil.so.0 -> libjavautil.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 27292 2012-01-01 19:23 libjavautil.so.0.0.0<br />
If you compile Gnu Classpath with --enable-alsa and --enable-xmlj, you have 6 more libraries in /usr/local/lib/classpath folder :<br />
-rwxr-xr-x 1 ubuntu ubuntu 877 2012-01-08 00:53 libgjsmalsa.la<br />
-rwxr-xr-x 1 ubuntu ubuntu 67246 2012-01-08 00:53 libgjsmalsa.so<br />
-rwxr-xr-x 1 ubuntu ubuntu 876 2012-01-08 00:53 libxmlj.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so -> libxmlj.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 16 2012-01-08 00:53 libxmlj.so.0 -> libxmlj.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 381252 2012-01-08 00:53 libxmlj.so.0.0.0<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/lib/security <br />
total 4<br />
-rw-r--r-- 1 ubuntu ubuntu 2489 2012-01-01 19:23 classpath.security<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share<br />
total 12<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 classpath<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:22 info<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:22 man<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/classpath<br />
total 10780<br />
-rw-r--r-- 1 ubuntu ubuntu 9832050 2012-01-01 19:22 glibj.zip<br />
-rw-r--r-- 1 ubuntu ubuntu 1204211 2012-01-01 19:23 tools.zip<br />
If you compile Gnu Classpath with --with-escher and --enable-collections, you have 2 more files in /usr/local/share/classpath folder :<br />
-rw-r--r-- 1 ubuntu ubuntu 382375 2012-01-08 00:53 collections.jar<br />
-rw-r--r-- 1 ubuntu ubuntu 515042 2012-01-07 16:07 escher-0.3.jar<br />
<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/info <br />
total 292<br />
-rw-r--r-- 1 ubuntu ubuntu 83532 2012-01-01 19:22 cp-hacking.info<br />
-rw-r--r-- 1 ubuntu ubuntu 106990 2012-01-01 19:22 cp-tools.info<br />
-rw-r--r-- 1 ubuntu ubuntu 98304 2012-01-01 19:22 cp-vmintegration.info<br />
-rw-r--r-- 1 ubuntu ubuntu 815 2012-01-01 19:22 dir<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man <br />
total 4<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:23 man1<br />
*<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox classpath-0.98 $ ls -l /usr/local/share/man/man1<br />
total 164<br />
-rw-r--r-- 1 ubuntu ubuntu 7997 2012-01-01 19:22 gappletviewer.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5592 2012-01-01 19:23 gcjh.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5918 2012-01-01 19:23 gjar.1<br />
-rw-r--r-- 1 ubuntu ubuntu 9590 2012-01-01 19:23 gjarsigner.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5750 2012-01-01 19:23 gjavah.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35310 2012-01-01 19:23 gjdoc.1<br />
-rw-r--r-- 1 ubuntu ubuntu 35536 2012-01-01 19:23 gkeytool.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4594 2012-01-01 19:23 gnative2ascii.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4825 2012-01-01 19:23 gorbd.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5084 2012-01-01 19:23 grmid.1<br />
-rw-r--r-- 1 ubuntu ubuntu 5036 2012-01-01 19:23 grmiregistry.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4512 2012-01-01 19:23 gserialver.1<br />
-rw-r--r-- 1 ubuntu ubuntu 4592 2012-01-01 19:23 gtnameserv.1<br />
<br />
== JamVM ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/bin<br />
total 444<br />
-rwxr-xr-x 1 ubuntu ubuntu 400821 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/include<br />
total 108<br />
-rw-r--r-- 1 ubuntu ubuntu 14042 2012-01-01 19:38 jni.h<br />
<br />
'''Note''' : JamVM replace the jni.h file from Gnu Classpath by his own jni.h file <br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/lib <br />
total 636<br />
-rwxr-xr-x 1 ubuntu ubuntu 817 2012-01-01 19:37 libjvm.la<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so -> libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 15 2012-01-01 19:37 libjvm.so.0 -> libjvm.so.0.0.0<br />
-rwxr-xr-x 1 ubuntu ubuntu 556829 2012-01-01 19:37 libjvm.so.0.0.0<br />
lrwxrwxrwx 1 ubuntu ubuntu 46 2012-01-01 19:38 rt.jar -> /usr/local/share/classpath/glibj.zip<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share<br />
total 16<br />
drwxr-xr-x 2 ubuntu ubuntu 4096 2012-01-01 19:38 jamvm<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jamvm-1.5.4 $ ls -l /usr/local/share/jamvm <br />
total 24 <br />
-rw-r--r-- 1 ubuntu ubuntu 22133 2009-12-31 19:42 classes.zip<br />
<br />
== Jikes ==<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/bin<br />
total 8260<br />
-rwxr-xr-x 1 ubuntu ubuntu 8002423 2012-01-01 19:56 jikes<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/include<br />
total 116<br />
<br />
-rw-r--r-- 1 ubuntu ubuntu 5794 2012-01-01 19:56 jikesapi.h<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share<br />
total 20<br />
<br />
drwxr-xr-x 3 ubuntu ubuntu 4096 2012-01-01 19:56 doc<br />
<br />
[SB2 mapping-armv7 armv7] ubuntu@ubuntu-VirtualBox jikes-1.22 $ ls -ltr /usr/local/share/doc/jikes-1.22<br />
total 12<br />
-rw-r--r-- 1 ubuntu ubuntu 11886 2012-01-01 19:56 license.htm<br />
<br />
= Links used to do the webOS port =<br />
<br />
== Iphone ==<br />
<br />
Patches used for the JamVM port for Iphone <br />
http://test.saurik.com/iphone/jamvm/<br />
<br />
IPhone Java<br />
http://web.archive.org/web/20071230000038/http://iphone.fiveforty.net/wiki/index.php/IPhone_Java<br />
<br />
Talk:IPhone Java<br />
http://web.archive.org/web/20071230050607/http://iphone.fiveforty.net/wiki/index.php/Talk:IPhone_Java<br />
<br />
(JamVM Forum) JamVM port to iPhone?<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/1866438<br />
<br />
Tutorials Java on Iphone :<br />
http://iphoneroot.com/category/java/<br />
http://iphoneroot.com/tutorial-install-java-on-the-iphone/<br />
<br />
== JamVM ==<br />
<br />
JamVM developer blog<br />
http://draenog.blogspot.com/<br />
<br />
how to build GNU Classpath and JamVM<br />
http://sourceforge.net/projects/jamvm/forums/forum/256481/topic/3208847?message=7193290<br />
http://free-electrons.com/doc/java-labs.odt<br />
http://wiki.chumby.com/index.php/Java<br />
http://fuseyism.com/openjdk/cvmi/jamvmport.xhtml<br />
<br />
JamVM used in Ubuntu <br />
https://launchpad.net/ubuntu/oneiric/+source/openjdk-6/6b23~pre4-0ubuntu1<br />
with the latest code in GIT ???<br />
http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html<br />
<br />
== OpenJDK ==<br />
<br />
For the future when the next JamVM release will be available, replace Gnu Classpath by OpenJDK Java classes :<br />
<br />
CrossCompilingOpenJDK<br />
https://evolvis.org/plugins/mediawiki/wiki/jalimo/index.php/CrossCompilingOpenJDK<br />
<br />
CrossCompileFaq<br />
http://icedtea.classpath.org/wiki/CrossCompileFaq<br />
<br />
JDK6 for embedded ARM<br />
http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html</div>
Yannick56
http://wiki.webos-internals.org/index.php?title=Default_packages_available_in_several_webOS_release&diff=21333
Default packages available in several webOS release
2012-01-08T22:06:09Z
<p>Yannick56: /* webOS 2.1.0 wr */ update</p>
<hr />
<div>= webOS 1.4.5 =<br />
<br />
webosdoctorp101ueu-wr-Pre_Plus_1.4.5.jar<br />
<br />
root@palm-webos-device:/# ipkg list<br />
<br />
alsa-conf-base - 1.0.18-2.1 - <br />
alsa-lib - 1.0.18-2.1 - <br />
alsa-plugins - 1.0.18-4 - <br />
alsa-utils - 1.0.18-2 - <br />
alsa-utils-alsactl - 1.0.18-2 - <br />
alsa-utils-amixer - 1.0.18-2 - <br />
alsa-utils-aplay - 1.0.18-2 - <br />
applicationinstallerutility - 1.0-8 - <br />
atomicparsley - 0.9.0-5 - <br />
audiod - 1.1-245.3 - <br />
audiod-config - 1.0-83 - <br />
audiod-config-eu - 1.0-7 - Audio Policy Manager EU Configuration<br />
base-files - 3.0.14.4-14 - <br />
base-passwd - 3.5.9-r6 - <br />
bcprov - 1.41-2 - <br />
binutils - 2.17.50.0.8-r1 - <br />
boost - 1.39.0-r0 - <br />
boost-program-options - 1.39.0-r0 - <br />
bootchart - 0.9-r2 - <br />
bootloader - 1.0.0-191.4 - <br />
brctl - 1.2-2 - <br />
browser-adapter - 1.0.1-118 - <br />
browserserver - 1.0.0-204.5 - <br />
bsdiff - 4.3-2 - <br />
bspatch-xz - 1.0.0-1 - <br />
busybox - 1.11.3-15 - <br />
bzip2 - 1.0.2-r3 - <br />
cairo - 1.3.14-r0 - <br />
camd-omap34xx - 1.0.1-41 - <br />
camsrc-omap34xx - 1.0.0-36 - <br />
castletpfw - 1.0.2-15 - <br />
castleumtsfw-row - 1.0.0-93 - Modem Firmware package for Castle UMTS device<br />
cifs - 3.0.23c-1 - <br />
cjson - 1.0-22.1 - <br />
codesourcery-arm - 2007q3-1 - <br />
com.motionapps.rom.classic - 1.0.0-34 - <br />
com.motionapps.service.classic - 1.0.0-34 - <br />
com.palm.app.backup - 1.0-61 - <br />
com.palm.app.bluetooth - 1.0-114 - <br />
com.palm.app.browser - 1.0-112 - <br />
com.palm.app.calculator - 1.0-31 - <br />
com.palm.app.calendar - 1.0-181.2 - <br />
com.palm.app.camera - 1.0-131 - <br />
com.palm.app.certificate - 1.0-24.1 - <br />
com.palm.app.clock - 1.0-27.1 - <br />
com.palm.app.collectlogs - 1.0-39 - <br />
com.palm.app.contacts - 1.0-177.10 - <br />
com.palm.app.crotest - 1.0-23 - <br />
com.palm.app.dataimport - 1.0-24 - <br />
com.palm.app.dateandtime - 1.0-54 - <br />
com.palm.app.deviceinfo - 1.0-78 - <br />
com.palm.app.devmodeswitcher - 1.0-3 - <br />
com.palm.app.docviewer - 1.0-79 - <br />
com.palm.app.email - 1.0-340 - <br />
com.palm.app.findapps - 1.0-182 - <br />
com.palm.app.firstuse - 1.0-198.2 - <br />
com.palm.app.firstuse-override - 1.0-198.2 - First Use application files for Castle+, which requires special handling in the short-term<br />
com.palm.app.help - 1.0-45 - <br />
com.palm.app.languagepicker - 1.0-42 - <br />
com.palm.app.location - 1.0-19 - <br />
com.palm.app.maps - 1.0-32 - <br />
com.palm.app.messaging - 1.0-186.1 - <br />
com.palm.app.monad - 1.0-1 - <br />
com.palm.app.musicplayer - 1.0-169 - <br />
com.palm.app.notes - 1.0-51 - <br />
com.palm.app.odd - 1.0-21 - <br />
com.palm.app.ondevicedemo - 1.0-7.1 - <br />
com.palm.app.ondevlog - 1.0-3 - <br />
com.palm.app.pdfviewer - 1.2-74 - <br />
com.palm.app.phone - 1.0-237.16.5 - <br />
com.palm.app.phoneprefs - 1.0-105.2 - <br />
com.palm.app.photos - 1.0-100114.7 - <br />
com.palm.app.screenlock - 1.0-64 - <br />
com.palm.app.soundsandalerts - 1.0-38 - <br />
com.palm.app.streamingmusicplayer - 1.0-43 - <br />
com.palm.app.tasks - 1.0-68 - <br />
com.palm.app.updates - 1.0-85.3 - <br />
com.palm.app.usbpassthrough - 1.0-31 - <br />
com.palm.app.videoplayer - 1.0-105 - <br />
com.palm.app.wifi - 1.0-74.4 - <br />
com.palm.app.youtube - 1.0-37 - <br />
com.palm.crotest - 1.0-18 - <br />
com.palm.photo.facebook - 1.0-14 - <br />
contextupload - 1.0-15 - <br />
crotestcastleplus-images - 1.0-2 - Images used by luna app com.palm.app.crotest<br />
cryptofs - 0.6.0-7.1 - <br />
cryptsetup - 1.0.6-r2 - <br />
curl - 7.19.7-2 - <br />
cypress-multitouch - 1.0.0-36 - <br />
dbus - 1.1.20-1.1 - <br />
dbus-lib - 1.1.20-1.1 - <br />
dbus-util - 1.0-4 - <br />
default-content - 1.0.0-19 - Default Palm content<br />
dhcp-client - 3.0.2-r5 - <br />
directfb - 1.1.0-9 - <br />
dns-sd - 107.6.0-9 - <br />
dnsmasq - 2.51-2 - <br />
docadapterbase - 1.0.0-16 - <br />
documentserver - 1.0.1-90.1 - <br />
domparser - 1.0-11 - <br />
dosfstools - 3.0.2-r1 - <br />
downloadupdate - 1.0.0-53 - <br />
dspmon-omap34xx - 1.0.0-7 - <br />
e2fsprogs - 1.41.4.1-3 - <br />
e2fsprogs-badblocks - 1.41.4.1-3 - <br />
e2fsprogs-blkid - 1.41.4.1-3 - <br />
e2fsprogs-e2fsck - 1.41.4.1-3 - <br />
e2fsprogs-fsck - 1.41.4.1-3 - <br />
e2fsprogs-libs - 1.41.4-r0 - <br />
e2fsprogs-mke2fs - 1.41.4.1-3 - <br />
e2fsprogs-tune2fs - 1.41.4.1-3 - <br />
e2fsprogs-uuidgen - 1.41.4.1-3 - <br />
eglsubdrv - 1.0-11.2 - <br />
exmap-console - 0.4.1-r2 - <br />
expat - 1.95.8-r1 - <br />
extractfs - 1.0.3-62 - <br />
faac - 1.24-r0 - <br />
fbdraw - 1.0.0-5 - <br />
fbset - 2.1-r2 - <br />
ffmpeg - svnr21340-8 - <br />
fileindexer - 1.0.1-123 - <br />
firstuse-media-castleplus - 1.0-3 - Castle+ Media file used by luna app com.palm.app.firstuse<br />
flash - 1.0-60 - <br />
flash-mini-adapter - 1.0.0-7 - <br />
fnmbl-clientapi - 1.0-27 - <br />
fnmbl-clientframework - 1.0-2.1 - <br />
fontconfig - 2.6.0-r2.1 - <br />
fontconfig-utils - 2.6.0-r2.1 - <br />
foundations.base - 1.0-29 - <br />
foundations.json - 1.0-7 - <br />
foundations.mojo - 1.0-10 - <br />
foundations.xml - 1.0-3 - <br />
freefont-ttf - 20061128-r1 - <br />
freetype - 2.3.6-r1 - <br />
fuse - 2.7.2-r2 - <br />
fuse-utils - 2.7.2-r2 - <br />
fuser - 22.2-r1 - <br />
gdata-java-client - 1.0-7 - <br />
gdb - 6.8-r0 - <br />
gdbm - 1.8.3-r3 - <br />
geolocation-adapter - 1.0-9 - <br />
giflib - 4.1.6-r2 - <br />
glib-2.0 - 2.16.6-r5 - <br />
glibmm - 2.16.4-r0 - <br />
gloox - 1.0-17 - <br />
gmflag - 1.0.0-1 - <br />
gnutls - 1.6.1-r1 - <br />
goodfork - 1.0.0-3 - <br />
google-rfc-2445 - 1.0-5 - <br />
gst-ffmpeg - 0.10.6-r26 - <br />
gst-plugins-bad - 0.10.9-r24 - <br />
gst-plugins-base - 0.10.21-r31 - <br />
gst-plugins-good - 0.10.11-r52 - <br />
gstreamer - 0.10.21-r25 - <br />
harmony - 5.0.r603534-67 - <br />
harmonykernel - 1.0.0-21 - <br />
hidaccelerometer - 1.0.0-25.1 - <br />
hidavrcp - 1.0.0-1001 - <br />
hidd - 1.0.0-50 - <br />
hiddiag - 1.0.0-7 - <br />
hidkeypad - 1.0.0-35.2 - <br />
hidlib - 1.0.0-37.1 - <br />
hidlight - 1.0.0-13 - <br />
hidproximity - 1.0.0-15 - <br />
hidqemukeypad - 1.0.0-5 - <br />
hidqemutouchpanel - 1.0.0-5 - <br />
hidtouchpanel - 1.0.0-158.6 - <br />
icu4j - 3.8-3 - <br />
icu4jni - 3.6-5 - <br />
initscripts - 1.1-41.22 - <br />
install-first - 1.0.0-16.4 - <br />
integcheck - 1.0-11 - <br />
ipkg - 0.99.163-r8 - <br />
iproute2 - 2.6.29-2 - <br />
iptables - 1.4.2-1 - <br />
iptables-utils - 1.4.2-1 - <br />
iputils - 20071127-4 - <br />
iputils-arping - 20071127-4 - <br />
jail - 1.0-31 - <br />
java-activerecord - 1.0-100 - <br />
java-async - 1.0-6.1 - <br />
java-com.palm.accounts - 1.0-105 - <br />
java-com.palm.accountservices - 1.0-100 - <br />
java-com.palm.backup - 1.0-92 - <br />
java-com.palm.calendar - 1.0-117 - <br />
java-com.palm.carriernetworksettings - 1.0-88.8 - <br />
java-com.palm.contacts - 1.0-123 - <br />
java-com.palm.customization - 1.0-39 - <br />
java-com.palm.dataimport - 1.0-25 - <br />
java-com.palm.datamigration - 1.0-16 - <br />
java-com.palm.defaultdatabasebuilder - 1.0-7 - <br />
java-com.palm.deviceprofile - 1.0-43 - <br />
java-com.palm.devicewipe - 1.0-8 - <br />
java-com.palm.facebook - 1.0-18 - <br />
java-com.palm.findapps - 1.0-1.1 - <br />
java-com.palm.interfaceregistry - 1.0-3.1 - <br />
java-com.palm.location - 1.0-67 - <br />
java-com.palm.mail - 1.0-341 - <br />
java-com.palm.mediaevents - 1.0-12 - <br />
java-com.palm.messaging - 1.0-230 - <br />
java-com.palm.messagingrouter - 1.0-46 - <br />
java-com.palm.notes - 1.0-3 - <br />
java-com.palm.packageinfo - 1.0-9.1 - <br />
java-com.palm.photos - 1.0-6 - <br />
java-com.palm.pim - 1.0-198 - <br />
java-com.palm.pimsync - 1.0-142 - <br />
java-com.palm.scheduler - 1.0-38 - <br />
java-com.palm.serviceboot - 1.0-42 - <br />
java-com.palm.superlog - 1.0-19.1 - <br />
java-com.palm.tasks - 1.0-28 - <br />
java-com.palm.telephony - 1.0-193 - <br />
java-md5 - 1.0-3 - <br />
java-service - 1.0-58 - <br />
java-utils - 1.0-64 - <br />
java-zone-info - 1.0-2 - <br />
jemalloc - 1.0-3 - <br />
joda-time - 1.0-3.1 - <br />
jpeg - 6b-r6 - <br />
jpegdecodelib-omap34xx - 1.0.0-11 - <br />
jpegtranscodeclient-omap34xx - 1.0.0-7 - <br />
jpegtranscodeserver-omap34xx - 1.0.0-16 - <br />
jwap - 1.2.cvs04012008-7 - <br />
kernel - 2.6.24-281.1.23.2 - <br />
kernel-dev - 2.6.24-281.1.23.2 - <br />
kernel-image-2.6.24-palm-joplin-3430 - 2.6.24-281.1.23.2 - <br />
kernel-module-ecb - 2.6.24-281.1.23.2 - <br />
kernel-module-ifb - 2.6.24-281.1.23.2 - <br />
kernel-module-nbd - 2.6.24-281.1.23.2 - <br />
kernel-module-oprofile - 2.6.24-281.1.23.2 - <br />
kernel-module-pcbc - 2.6.24-281.1.23.2 - <br />
kernel-module-scsi-wait-scan - 2.6.24-281.1.23.2 - <br />
kernel-modules - 2.6.24-281.1.23.2 - <br />
killall - 22.2-r1 - <br />
klog - 1.0-1 - <br />
ksoap - 2.1.1-2 - <br />
libasound - 1.0.18-2.1 - <br />
libasound-module-ctl-pulse - 1.0.18-4 - <br />
libasound-module-pcm-pulse - 1.0.18-4 - <br />
libavcodec - svnr21340-8 - <br />
libavdevice - svnr21340-8 - <br />
libavformat - svnr21340-8 - <br />
libavutil - svnr21340-8 - <br />
libcommonservices - 107.6.0-9 - <br />
libcrypto - 0.9.8j-r2 - <br />
libcurl - 7.19.7-2 - <br />
libdnssd - 107.6.0-9 - <br />
libfaac - 1.24-r0 - <br />
libgcrypt - 1.4.4-r0 - <br />
libgdbus - 1.0.0-r7 - <br />
libgpg-error - 1.4-r1 - <br />
libgpod - 0.6.0-r0 - <br />
libhelpers - 1.0-3 - <br />
libhostap - 0.6.9-23 - <br />
libicudata - 3.6-r2 - <br />
libicui18n - 3.6-r2 - <br />
libicuio - 3.6-r2 - <br />
libicule - 3.6-r2 - <br />
libiculx - 3.6-r2 - <br />
libicutu - 3.6-r2 - <br />
libicuuc - 3.6-r2 - <br />
libipkg - 0.99.163-r8 - <br />
libltdl - 1.5.24-r1 - <br />
libmatthew-java - 0.7-r2 - <br />
libnapp - 1.0-49.2 - <br />
libnetbridge - 1.2-2 - <br />
libnetfilter-queue - 0.0.17-1 - <br />
libnfnetlink - 1.0.0-1 - <br />
libnssmdns - 107.6.0-9 - <br />
libogg - 1.1.3-r1 - <br />
liboil - 0.3.14-r0 - <br />
libpcap - 0.9.3-r2 - <br />
libpdl - 1.0-41 - <br />
libpng - 1.2.42-r5 - <br />
libpng12 - 1.2.42-r5 - <br />
libpulse - 0.9.14-46.3 - <br />
libpulse-simple - 0.9.14-46.3 - <br />
libpulsecore - 0.9.14-46.3 - <br />
libpurple - 1.0-r25 - <br />
libpurple-adapter - 1.0-77 - <br />
libsamplerate0 - 0.1.2-r2 - <br />
libsdl - 1.2-67 - <br />
libsdl-cinema - 1.0-12 - <br />
libsdl-image - 1.2-3 - <br />
libsdl-mixer - 1.2-9 - <br />
libsdl-net - 1.2-1 - <br />
libsdl-ttf - 1.2-1 - <br />
libsigcpp-2.0 - 2.0.17-r1 - <br />
libsndfile1 - 1.0.17-r5 - <br />
libspeex - 1.2rc1-r3 - <br />
libsqlite - 3.6.20-r0 - <br />
libssl - 0.9.8j-r2 - <br />
libswscale - svnr21340-8 - <br />
libsysfs - 2.0.0-r0 - <br />
libulockmgr - 2.7.2-r2 - <br />
libupstart - 0.3.8-19-r2 - <br />
libvolume-id - 115.1-6 - <br />
libvorbis - 1.2.0-r0 - <br />
libwps - 0.6.9-23 - <br />
libxml2 - 2.6.26-r3 - <br />
libxslt - 1.1.17-r6 - <br />
locationadapter - 1.0-21 - <br />
logctld - 1.0-37 - <br />
luna-applauncher - 1.0-123.4 - <br />
luna-downloadmgr - 1.0-58 - <br />
luna-fonts - 1.0-17 - <br />
luna-init - 1.0-59 - <br />
luna-keymap-headers - 1.0-14 - <br />
luna-keymaps - 1.0-48 - <br />
luna-media-shim - 1.0-21 - <br />
luna-network - 1.0-19 - <br />
luna-prefs - 1.0-52 - <br />
luna-pseudocard - 1.0-14 - <br />
luna-service - 1.0.0-65.1 - <br />
luna-sysmgr - 1.0-708.34 - <br />
luna-sysmgr-ipc - 1.0-16 - <br />
luna-sysservice - 1.0-95 - <br />
luna-systemui - 1.0-195.23 - <br />
luna-webkit - 4v8-80.19.35 - <br />
lvm2 - 2.02.44-r2 - <br />
lvm2-config - 2.02.44-r2 - <br />
lvm2-static - 2.02.44-r2 - <br />
makedevs - 1.0.0-r2 - <br />
marvell8686microap - 1.0.0-4 - <br />
masflib - 1.0-5 - <br />
mdnsd - 107.6.0-9 - <br />
mediaadpcmdecodelib - 1.0.0-1 - <br />
mediaextension - 1.0-20 - <br />
mediametaserver - 1.0.0-3 - <br />
mediaserver - 1.1.0-345.21 - <br />
mediastream - 1.0-21 - <br />
memchute - 1.0.0-19 - <br />
metascene.base - 1.0-5 - <br />
metascene.videos.base - 1.0-76.5 - <br />
metascene.videos.share - 1.0-48 - <br />
minicore2 - 1.0.0-20 - <br />
minidhcpd - 1.0.1-28 - <br />
mjson - 1.0-15 - <br />
mkbootfs-tools - 1.0-7 - <br />
mobilehotspotd - 1.0.1-38 - <br />
module-init-tools - 3.2.2-r3 - <br />
module-init-tools-depmod - 3.2.2-r3 - <br />
modutils-initscripts - 1.0-r2 - <br />
mojo - 1.0-347 - <br />
mojodbshim - 1.0-2 - <br />
mojoloader - 1.0-20 - <br />
mountcfs - 1.0-10 - <br />
mtools - 4.0.10-r3 - <br />
natool - 1.0.0-4 - <br />
ncurses - 5.4-r9 - <br />
net-tools-netstat - 1.60-r3 - <br />
netbase - 4.21-r17 - <br />
netcat - 0.7.1-r1 - <br />
novacom - 1.0-13 - <br />
novacomd - 1.0-77.1 - <br />
npapiinterfacelib - 1.0.0-44 - <br />
ntpdate - 4.2.2p3-r1 - <br />
oasisharmonyvm - 1.0-107 - <br />
officeadapter - 1.0.0-50 - <br />
officeserver - 1.0.0-76 - <br />
omadm - 1.0.0-124 - <br />
omxclientlib-omap34xx - 1.0.0-14 - <br />
ondevicedemod - 1.0.5-60 - <br />
ondevlogger - 1.0.0-4 - <br />
opencore-amr - 0.1.2-1 - <br />
opengles - 1.0.0-1 - <br />
opengles-omap3 - 1.0.0-1 - <br />
openssl - 0.9.8j-r2 - <br />
oprofile - 0.9.6-r14 - <br />
org.json - 1.0-2.1 - <br />
ossinfo - 1.0.0-19 - <br />
palmaacdemux - 1.0.0-27 - <br />
palmadpcmdecoder - 1.0.0-6 - <br />
palmamrdemux - 1.0.0-11 - <br />
palmaudiodecoder-omap34xx - 1.0.0-55 - <br />
palmaudioencoder-omap34xx - 1.0.0-23 - <br />
palmbuildinfo - 1.0.4-222 - <br />
palmcustomizationinfo-wr-castle-plus - 1.0-222 - wr-castle-plus Customization Info<br />
palmhttpsrc - 1.0.0-55 - <br />
palmipc-java - 1.0.0-21 - <br />
palmjpgencsink-omap34xx - 1.0.0-52 - <br />
palmmp3demux - 1.0.0-88.3 - <br />
palmmp4mux - 1.0.0-64 - <br />
palmqcelpdemux - 1.0.0-15 - <br />
palmvibelib - 1.0-10 - <br />
palmvideodecoder-omap34xx - 1.0.0-49 - <br />
palmvideoencoder-omap34xx - 1.0.0-37 - <br />
palmvideosink-omap34xx - 1.0.0-65 - <br />
passthrud - 1.0.6-60 - <br />
pbnjson - 1.0.0-16.5 - <br />
pdfadapter - 1.0.0-41 - <br />
perftimer - 1.0-12 - <br />
piranha - 1.2-78 - <br />
pmbtcontacts - 1.0.0-1.4.2 - <br />
pmbtengine - 1.0.0-1.4.16 - <br />
pmbtlib - 1.0.0-1.4.0 - <br />
pmbtos - 1.0.0-1.4.5 - <br />
pmbtstack - 1.0.5-1.4.1.5 - <br />
pmbtstartup - 1.0.0-1.4.1.2 - <br />
pmcasper - 1.0.0-15 - <br />
pmcertificatemgr - 1.0.0-14 - <br />
pmcertificatemgrservice - 1.0.0-20 - <br />
pmcertstore - 1.0.3-10 - <br />
pmeloop - 1.0.0-3 - <br />
pmipcdispatch - 1.0.0-8 - <br />
pmipclib - 1.0.0-44.4 - <br />
pmklogd - 1.0.0-6 - <br />
pmlinuxmodemcmd - 1.0.0-6 - <br />
pmlogctl - 1.0.0-7 - <br />
pmlogdaemon - 1.0.0-68.13 - <br />
pmloglib - 1.0.0-12 - <br />
pmmedia - 1.0.0-2 - <br />
pmmedia-omap34xx - 1.0.0-2 - <br />
pmmodemefslogger - 1.0.0-8 - <br />
pmmodeminfo - 1.0.0-21 - <br />
pmmodempower - 1.0-5 - <br />
pmmodemupdater - 1.0.0-87 - <br />
pmnetconfiglib - 1.0.0-13 - <br />
pmnetconfigmanager - 1.0.0-84.1 - <br />
pmnetworking - 1.0.0-0 - <br />
pmnetworking-castle - 1.0.0-0 - <br />
pmtelephony - 1.0.0-1 - <br />
pmtelephony-msm6xxx - 1.0.0-1 - <br />
pmtpupdater - 1.0.1-29 - <br />
pmupdater - 1.0.0-117 - <br />
pmwandaemon - 1.0.0-136 - <br />
pmwanpppplugin - 1.0.0-15 - <br />
pmwifidriver - 1.0.0-62.1 - <br />
pmwifiservice - 1.0.0-90.22 - <br />
popt - 1.7-r4 - <br />
popvol - 1.0.0-6 - <br />
powerd - 1.0.0-200.2 - <br />
ppp - 2.4.3-r3 - <br />
procps - 3.2.7-r8 - <br />
psmisc - 22.2-r1 - <br />
pstree - 22.2-r1 - <br />
pubsubservice - 1.0-81 - <br />
pulseaudio - 0.9.14-46.3 - <br />
pulseaudio-lib-alsa-util - 0.9.14-46.3 - <br />
pulseaudio-lib-auth-cookie - 0.9.14-46.3 - <br />
pulseaudio-lib-authkey - 0.9.14-46.3 - <br />
pulseaudio-lib-cli - 0.9.14-46.3 - <br />
pulseaudio-lib-iochannel - 0.9.14-46.3 - <br />
pulseaudio-lib-ioline - 0.9.14-46.3 - <br />
pulseaudio-lib-ipacl - 0.9.14-46.3 - <br />
pulseaudio-lib-packet - 0.9.14-46.3 - <br />
pulseaudio-lib-pdispatch - 0.9.14-46.3 - <br />
pulseaudio-lib-protocol-cli - 0.9.14-46.3 - <br />
pulseaudio-lib-protocol-native - 0.9.14-46.3 - <br />
pulseaudio-lib-pstream - 0.9.14-46.3 - <br />
pulseaudio-lib-pstream-util - 0.9.14-46.3 - <br />
pulseaudio-lib-socket-server - 0.9.14-46.3 - <br />
pulseaudio-lib-socket-util - 0.9.14-46.3 - <br />
pulseaudio-lib-strlist - 0.9.14-46.3 - <br />
pulseaudio-lib-tagstruct - 0.9.14-46.3 - <br />
pulseaudio-misc - 0.9.14-46.3 - <br />
pulseaudio-module-alsa-sink - 0.9.14-46.3 - <br />
pulseaudio-module-alsa-source - 0.9.14-46.3 - <br />
pulseaudio-module-cli - 0.9.14-46.3 - <br />
pulseaudio-module-cli-protocol-unix - 0.9.14-46.3 - <br />
pulseaudio-module-default-device-restore - 0.9.14-46.3 - <br />
pulseaudio-module-detect - 0.9.14-46.3 - <br />
pulseaudio-module-native-protocol-unix - 0.9.14-46.3 - <br />
pulseaudio-module-null-sink - 0.9.14-46.3 - <br />
pulseaudio-module-palm-a2dp-provider-sink - 0.9.14-46.3 - <br />
pulseaudio-module-palm-policy - 0.9.14-46.3 - <br />
pulseaudio-module-rescue-streams - 0.9.14-46.3 - <br />
pulseaudio-module-suspend-on-idle - 0.9.14-46.3 - <br />
pulseaudio-module-volume-restore - 0.9.14-46.3 - <br />
pulseaudio-server - 0.9.14-46.3 - <br />
rdxd - 1.0.1-70.5 - <br />
readline - 4.3-r4 - <br />
redbend - 2.1.1.13-2 - <br />
remote-adapter - 1.0-12 - <br />
remote-adapter-ipc - 1.0-10 - <br />
rsync - 2.6.9-r0 - <br />
saxparser - 1.0-15 - <br />
screen - 4.0.2-r1 - <br />
setcharge - 0.1-7 - <br />
setserial - 2.17-r1 - <br />
shutdownscripts - 1.0.0-18 - <br />
smartkey - 1.0-20 - <br />
sqlite-service - 1.0-7 - <br />
sqlite3 - 3.6.20-r0 - <br />
sqlite3-palm-extension - 1.0-20 - <br />
sqlitejdbc - v053-4 - <br />
storaged - 1.0.3-93.4 - <br />
strace - 4.5.14-r4 - <br />
sweatshop-wr-castle - 1.0-50 - Version 1.0-50 of package sweatshop-wr-castle<br />
sysfsutils - 2.0.0-r0 - <br />
sysstat - 9.0.1-r1 - <br />
systemsoundsloader - 1.0.0-21 - <br />
sysvinit - 2.86-39 - <br />
sysvinit-pidof - 2.86-39 - <br />
tar - 1.17-r3 - <br />
telephonyinterfacelayer1cdma - 1.0.0-174 - <br />
telephonyinterfacelayer1gsm - 1.0.0-177 - <br />
telephonyinterfacelayercommon - 1.0.0-2 - <br />
tellbootie - 1.0-3 - <br />
thumbnailextractorlib-omap34xx - 1.0.0-21 - <br />
tiff - 3.7.1-r0 - <br />
timezone - 2009s-1 - <br />
tiopenmax - L23.8M3-130 - <br />
tisgxgfx - L23.17M3-27 - <br />
touchpanel-measure - 1.0-2 - <br />
transcodeserver - 1.0.0-15.1 - <br />
trenchcoat - 1.1-37.3.1 - <br />
triton - 1.0-10 - <br />
udev - 115.1-6 - <br />
unittest - 1.0-3 - <br />
update-modules - 1.0-r4 - <br />
update-rc.d - 0.7-r0 - <br />
updatedaemon - 1.0.0-177.3 - <br />
uploadd - 1.0.0-21 - <br />
upstart - 0.3.8-19-r2 - <br />
upstart-initscripts - 1.0-77.8 - <br />
upstart-sysvcompat - 0.3.8-19-r2 - <br />
uriparser - 0.7.4-r0 - <br />
usbmon - 1.0-5 - <br />
usbnet - 1.0.0-1 - <br />
util-linux-ng-blockdev - 2.14.2-r5 - <br />
util-linux-ng-ionice - 2.14.2-r5 - <br />
util-linux-ng-losetup - 2.14.2-r5 - <br />
util-linux-ng-mkswap - 2.14.2-r5 - <br />
util-linux-ng-swaponoff - 2.14.2-r5 - <br />
vibetonz - 1.0.0-4 - <br />
vibetonz-castle - 1.0.0-4 - <br />
wireless-tools - 29-r2 - <br />
wpasupplicant - 0.6.9-23 - <br />
wxwidgets - 2.8.7-r2 - <br />
zeroconfigd - 1.0.0-11 - <br />
zlib - 1.2.3-r2 -<br />
<br />
= webOS 2.1.0 wr =<br />
<br />
webosdoctorp101ueu-wr-Pre_Plus_2.1.0.jar<br />
<br />
root@palm-webos:/# ipkg list<br />
<br />
accounts.ui - 1.0-40.3 - <br />
acct - 6.3.99+6.4pre1-r0 - <br />
activitymanager - 1.5-83.1 - <br />
addressing - 1.0-33 - <br />
alsa-conf-base - 1.0.18-2.2 - <br />
alsa-lib - 1.0.18-2.2 - <br />
alsa-plugins - 1.0.18-7 - <br />
alsa-utils - 1.0.18-2 - <br />
alsa-utils-alsactl - 1.0.18-2 - <br />
alsa-utils-amixer - 1.0.18-2 - <br />
alsa-utils-aplay - 1.0.18-2 - <br />
amrnbcodec - 1.0-6 - <br />
apnmanager - 1.0-9 - <br />
app-ipkgs - 1.0-22 - <br />
applicationinstallerutility - 1.0-14 - <br />
armtoolchain - 4.3-234.6 - <br />
armtoolchain-gconv - 4.3-234.6 - <br />
atomicparsley - 0.9.0-5 - <br />
audiod - 1.1-332.16 - <br />
audiod-config - 1.0-92 - <br />
audiod-config-eu - 1.0-13 - Audio Policy Manager EU Configuration<br />
base-files - 3.0.14.5-34.1 - <br />
base-passwd - 3.5.9-r6palm1 - <br />
baseimage - 23.17M-r0 - <br />
binutils - 2.17.50.0.8.1-2 - <br />
boost - 1.39.0-r0palm2 - <br />
boost-filesystem - 1.39.0-r0palm2 - <br />
boost-program-options - 1.39.0-r0palm2 - <br />
boost-regex - 1.39.0-r0palm2 - <br />
boost-system - 1.39.0-r0palm2 - <br />
bootchart - 0.9-r3 - <br />
bootie-images - 1.0.2-17 - <br />
bootloader - 1.0.0-243.1.10 - <br />
brctl - 1.2-2 - <br />
browser-adapter - 1.0.2-131 - <br />
browserserver - 1.0.3-229.3.1 - <br />
bsdiff - 4.3-2 - <br />
bspatch-xz - 1.0.0-1 - <br />
busybox - 1.17.3-11 - <br />
bzip2 - 1.0.5-r3 - <br />
c-ares - 1.7.3-r1 - <br />
caja - 1.0-2 - <br />
calendar - 1.0-29 - <br />
calendar.dta - 1.0-17 - <br />
calendar.io - 1.0-21 - <br />
camd-omap34xx - 1.0.2-47 - <br />
camsrc-omap34xx - 1.0.1-41 - <br />
castletpfw - 1.0.2-15 - <br />
castleumtsfw-row - 1.0.1-1033 - Modem Firmware package<br />
cifs - 3.0.23c-1 - <br />
ciscoanyconnectclient - 1.0.1-26 - <br />
cjson - 1.0-27 - <br />
com.palm.app.accounts - 1.0-13 - <br />
com.palm.app.agendaview - 1.0-5 - <br />
com.palm.app.backup - 1.0-68.5 - <br />
com.palm.app.bluetooth - 1.0-2.0.0.4 - <br />
com.palm.app.browser - 1.0.1-140.3 - <br />
com.palm.app.calculator - 1.0-37 - <br />
com.palm.app.calendar - 1.0-274.3 - <br />
com.palm.app.camera - 1.0-170 - <br />
com.palm.app.certificate - 1.0-26 - <br />
com.palm.app.clock - 1.0-45 - <br />
com.palm.app.collectlogs - 1.0-44 - <br />
com.palm.app.contacts - 1.0-234 - <br />
com.palm.app.crotest - 1.0-29 - <br />
com.palm.app.dataimport - 1.0-67 - <br />
com.palm.app.dateandtime - 1.0-57 - <br />
com.palm.app.deviceinfo - 1.0-93 - <br />
com.palm.app.devmodeswitcher - 1.0-8 - <br />
com.palm.app.email - 1.0-445 - <br />
com.palm.app.exhibitionpreferences - 1.0-3 - <br />
com.palm.app.firstuse - 1.0-225.4 - <br />
com.palm.app.firstuse-override - 1.0-225.4 - First Use application files for Castle+, which requires special handling in the short-term<br />
com.palm.app.ftp - 1.0-13 - <br />
com.palm.app.help - 1.0-50 - <br />
com.palm.app.languagepicker - 1.0-54 - <br />
com.palm.app.location - 1.0-22 - <br />
com.palm.app.maps - 1.0-34 - <br />
com.palm.app.messaging - 1.0-250 - <br />
com.palm.app.monad - 1.0-4 - <br />
com.palm.app.musicplayer - 1.0-216 - <br />
com.palm.app.network - 1.0-7 - <br />
com.palm.app.notes - 1.0.1-72.1 - <br />
com.palm.app.oddcore - 1.0-22 - <br />
com.palm.app.ondevlog - 1.0-7 - <br />
com.palm.app.pdfviewer - 1.0-77 - <br />
com.palm.app.phone - 1.0-294.3 - <br />
com.palm.app.phoneprefs - 1.0-120 - <br />
com.palm.app.photos - 1.0-100178 - <br />
com.palm.app.screenlock - 1.0-71 - <br />
com.palm.app.searchpreferences - 1.0-17 - <br />
com.palm.app.soundsandalerts - 1.0-39 - <br />
com.palm.app.stk - 1.0-64 - SIM Toolkit<br />
com.palm.app.streamingmusicplayer - 1.0-46 - <br />
com.palm.app.swmanager - 1.0-22 - <br />
com.palm.app.tasks - 1.0.2-92 - <br />
com.palm.app.textassist - 1.0-19 - <br />
com.palm.app.timedetails - 1.0-1 - <br />
com.palm.app.updates - 1.0-101 - <br />
com.palm.app.usbpassthrough - 1.0-34 - <br />
com.palm.app.videoplayer - 1.0-148 - <br />
com.palm.app.vpn - 1.0-45 - <br />
com.palm.app.wifi - 1.0-98 - <br />
com.palm.app.wlmcustomlogin - 1.0-6.4 - SFR WLM Custom Login UI<br />
com.palm.app.youtube - 1.0-44 - <br />
com.palm.crotest - 1.0-23 - <br />
com.palm.messaging.chatthreader - 1.0-43 - <br />
com.palm.messaging.smstest - 1.0-5 - <br />
com.palm.service.accounts - 1.0-42.3 - <br />
com.palm.service.appcatalog - 1.0-20 - <br />
com.palm.service.backup - 1.0-30.3 - <br />
com.palm.service.bluetooth.spp - 1.0-12 - <br />
com.palm.service.calendar.facebook - 1.0-15 - <br />
com.palm.service.calendar.google - 1.0-46 - <br />
com.palm.service.calendar.reminders - 1.0-26 - <br />
com.palm.service.calendar.yahoo - 1.0-28 - <br />
com.palm.service.collectlogs - 1.0-5 - <br />
com.palm.service.contacts.base - 1.0-25 - <br />
com.palm.service.contacts.facebook - 1.0-52 - <br />
com.palm.service.contacts.google - 1.1-38 - <br />
com.palm.service.contacts.linkedin - 1.0-53 - <br />
com.palm.service.contacts.linker - 1.0-70 - <br />
com.palm.service.contacts.sim - 1.0-22 - Sim Service<br />
com.palm.service.contacts.yahoo - 1.0-36 - <br />
com.palm.service.customization - 1.0-15.1 - <br />
com.palm.service.datatransfer - 1.0-26 - <br />
com.palm.service.deviceprofile - 1.0-6.3 - <br />
com.palm.service.dwipe - 1.0-7 - <br />
com.palm.service.ftp - 1.0-15 - <br />
com.palm.service.locale - 1.0-1 - <br />
com.palm.service.mediabroadcast - 1.0-12 - <br />
com.palm.service.mediacache - 1.0-15 - <br />
com.palm.service.migration - 1.0-38 - <br />
com.palm.service.migrationscript - 1.0-2 - <br />
com.palm.service.palmprofile - 1.0-28 - <br />
com.palm.service.photos.facebook - 1.0-8 - <br />
com.palm.service.photos.photobucket - 1.0-11 - <br />
com.palm.service.videos.facebook - 1.0-10 - <br />
com.palm.service.videos.youtube - 1.0-12 - <br />
com.palm.sfrvvm - 1.0.1-16 - Luna Service for SFR VVM<br />
com.palm.synergy.templates.builtins - 1.0-30 - <br />
com.palm.yahoo.authservice - 1.0.1-14.3 - <br />
com.quickoffice.webos - 1.0-696 - <br />
compcache - 1.0.0-3 - <br />
configurator - 1.2-34 - <br />
contacts.base - 1.0-98 - <br />
contacts.plugin.messaging - 1.0-12 - <br />
contacts.plugin.phone - 1.0-7 - <br />
contacts.plugin.pmvoicecommand - 1.0-2 - WebOS Contacts Plugin for voicecommand<br />
contacts.plugin.smartkey - 1.0-2 - <br />
contacts.ui - 1.0-38 - <br />
contextupload - 1.0-24 - <br />
cplite - 1.2-18 - <br />
crotestcastleplus-images - 1.0-2 - Images used by luna app com.palm.app.crotest<br />
cryptofs - 0.6.0-13 - <br />
cryptsetup - 1.0.6-r2 - <br />
curl - 7.21.0-5 - <br />
cypress-multitouch - 1.0.0-43 - <br />
dataexport - 1.0-45 - <br />
datamigration - 1.0-17 - <br />
deletemanager - 1.0.1-8 - <br />
dhcp-client - 3.0.2-r5palm2 - <br />
dns-sd - 107.6.0-9 - <br />
dnsmasq - 2.55-7 - <br />
docadapterbase - 1.0.0-16 - <br />
documentserver - 1.0.2-97 - <br />
dosfstools - 2.11-r1palm1 - <br />
downloadupdate - 1.0.0-70 - <br />
dspmon-omap34xx - 1.0.0-9 - <br />
e2fsprogs - 1.41.4.2-3 - <br />
e2fsprogs-badblocks - 1.41.4.2-3 - <br />
e2fsprogs-blkid - 1.41.4.2-3 - <br />
e2fsprogs-e2fsck - 1.41.4.2-3 - <br />
e2fsprogs-fsck - 1.41.4.2-3 - <br />
e2fsprogs-libs - 1.41.4-r0 - <br />
e2fsprogs-mke2fs - 1.41.4.2-3 - <br />
e2fsprogs-tune2fs - 1.41.4.2-3 - <br />
e2fsprogs-uuidgen - 1.41.4.2-3 - <br />
eglsubdrv - 1.0-36 - <br />
email-adapter - 1.0.0-4 - <br />
eventreporter - 1.0-3 - <br />
exmap-console - 1.0.0-4 - <br />
expat - 1.95.8-r1 - <br />
extractfs - 1.0.4-66 - <br />
faac - 1.24-r0 - <br />
facebook - 1.0-16 - <br />
fbdraw - 1.0.0-5 - <br />
fbprogress - 1.1-7 - <br />
fbset - 2.1-r2 - <br />
ffmpeg - 0.6-r1palm1 - <br />
filecache - 1.7-45.1 - <br />
filenotifyd - 1.0.6-49 - <br />
filenotifyd-triton - 1.0.10-83 - <br />
flash-mini-adapter - 1.0.1-15 - <br />
fontconfig - 2.6.0-r3 - <br />
fontconfig-utils - 2.6.0-r3 - <br />
foundations.base - 1.0-103 - <br />
foundations.crypto - 1.0-8 - <br />
foundations.io - 1.0-16 - <br />
foundations.json - 1.0-12 - <br />
foundations.mojo - 1.0-13 - <br />
foundations.xml - 1.0-7 - <br />
freetype - 2.3.12-r1 - <br />
fuse - 2.7.2-r2 - <br />
fuse-utils - 2.7.2-r2 - <br />
fuser - 22.2-r1 - <br />
gdbm - 1.8.3-r3 - <br />
geolocation-adapter - 1.1-15 - <br />
giflib - 4.1.6-r2 - <br />
glib-2.0 - 2.16.6-r5palm3 - <br />
glibcurl - 1.0.0-2 - <br />
glibmm - 2.16.4-r0 - <br />
globalization - 1.0-31 - <br />
gloox - 1.0-18 - <br />
gmflag - 1.0.0-1 - <br />
gnutls - 1.6.1-r1 - <br />
goodfork - 1.0.0-3 - <br />
gsm610 - 1.0-1 - <br />
gst-ffmpeg - 0.10.10-r8 - <br />
gst-plugins-bad - 0.10.18-r2 - <br />
gst-plugins-base - 0.10.29-r9 - <br />
gst-plugins-good - 0.10.22-r10.1 - <br />
gstreamer - 0.10.29-r3 - <br />
gzip - 1.3.5-r1 - <br />
hidaccelerometer - 1.0.0-40 - <br />
hidavrcp - 1.0.0-1.5.0.1 - <br />
hidcompass - 1.0.0-r0 - <br />
hidd - 1.0.0-65 - <br />
hiddiag - 1.0.0-10 - <br />
hidinputdev - 1.0.0-4 - <br />
hidkeypad - 1.0.0-48 - <br />
hidlib - 1.0.1-77 - <br />
hidlight - 1.0.0-26 - <br />
hidproximity - 1.0.0-26 - <br />
hidtouchpanel - 1.0.0-209 - <br />
hostapd - 0.6.10-26 - <br />
icu - 3.6-r2 - <br />
imaccountvalidator - 1.0-8 - <br />
image-extras-cust - 1.0-1 - <br />
image-extras-cust-default - 1.0-1 - <br />
imagethumbnail - 1.0-5 - <br />
imlibpurpleservice - 1.0-35 - <br />
imsfrtransport - 1.0.1-19.5 - Mojo SFR MSN IM Transport<br />
imyahootransport - 1.0-37 - <br />
initscripts - 1.1-101 - <br />
install-first - 1.0.2-17.38 - <br />
integcheck - 1.0-15 - <br />
ipkg - 0.99.163-r9 - <br />
iproute2 - 2.6.29-2 - <br />
iptables - 1.4.2-1 - <br />
iptables-utils - 1.4.2-1 - <br />
iputils - 20071127-4 - <br />
iputils-arping - 20071127-4 - <br />
jail - 1.0.2-53 - <br />
jemalloc - 1.0-7 - <br />
jpeg - 6b-r6 - <br />
jpegdecodelib-omap34xx - 1.0.0-12 - <br />
kernel - 2.6.24-359 - <br />
kernel-dev - 2.6.24-359 - <br />
kernel-image-2.6.24-palm-joplin-3430 - 2.6.24-359 - <br />
kernel-module-ecb - 2.6.24-359 - <br />
kernel-module-ifb - 2.6.24-359 - <br />
kernel-module-nbd - 2.6.24-359 - <br />
kernel-module-oprofile - 2.6.24-359 - <br />
kernel-module-pcbc - 2.6.24-359 - <br />
kernel-module-scsi-wait-scan - 2.6.24-359 - <br />
kernel-modules - 2.6.24-359 - <br />
keymanager - 1.0-32.6 - <br />
killall - 22.2-r1 - <br />
klog - 1.0-2 - <br />
libasound - 1.0.18-2.2 - <br />
libasound-module-ctl-pulse - 1.0.18-7 - <br />
libasound-module-pcm-pulse - 1.0.18-7 - <br />
libavcodec - 0.6-r1palm1 - <br />
libavdevice - 0.6-r1palm1 - <br />
libavformat - 0.6-r1palm1 - <br />
libavutil - 0.6-r1palm1 - <br />
libcommonservices - 107.6.0-9 - <br />
libcompass - 1.0.0-r0 - <br />
libcrypto - 0.9.8k-4 - <br />
libcurl - 7.21.0-5 - <br />
libdnssd - 107.6.0-9 - <br />
libexif - 0.6.17-r1 - <br />
libfaac - 1.24-r0 - <br />
libgcrypt - 1.4.4-r0 - <br />
libgpg-error - 1.4-r1 - <br />
libgpod - 0.6.0-r0 - <br />
libhelpers - 1.0-13 - <br />
libhostap - 0.6.10-26 - <br />
libicudata - 3.6-r2 - <br />
libicui18n - 3.6-r2 - <br />
libicuio - 3.6-r2 - <br />
libicule - 3.6-r2 - <br />
libiculx - 3.6-r2 - <br />
libicutu - 3.6-r2 - <br />
libicuuc - 3.6-r2 - <br />
libid3tag - 0.15.0b-r2 - <br />
libipkg - 0.99.163-r9 - <br />
libltdl - 1.5.24-r1 - <br />
libmemcpy - 1.0-9 - <br />
libnapp - 1.0-73 - <br />
libnetbridge - 1.2-2 - <br />
libnrwindow - 1.0-2 - <br />
libnssmdns - 107.6.0-9 - <br />
libogg - 1.1.3-r1 - <br />
liboil - 0.3.14-r0 - <br />
libopenal - 1.11.753-2 - <br />
libpalmsocket - 1.0-22.1 - <br />
libpcap - 0.9.3-r2 - <br />
libpdl - 1.0-60 - <br />
libpng - 1.2.44-r1 - <br />
libpng12 - 1.2.44-r1 - <br />
libpulse - 0.9.14-59.4 - <br />
libpulse-simple - 0.9.14-59.4 - <br />
libpulsecore - 0.9.14-59.4 - <br />
libpurple - 1.0-r25 - <br />
librdx - 1.0.0-116 - <br />
libsamplerate0 - 0.1.7-1 - <br />
libsdl - 1.2-87 - <br />
libsdl-cinema - 1.0-20 - <br />
libsdl-image - 1.2-3 - <br />
libsdl-mixer - 1.2-9 - <br />
libsdl-net - 1.2-1 - <br />
libsdl-ttf - 1.2-1 - <br />
libsigcpp-2.0 - 2.0.17-r1 - <br />
libsndfile1 - 1.0.17-r5 - <br />
libsoup - 2.4.1-r0 - <br />
libspeex - 1.2rc1-r3 - <br />
libsqlite - 3.6.20-r0 - <br />
libssl - 0.9.8k-4 - <br />
libswscale - 0.6-r1palm1 - <br />
libsysfs - 2.0.0-r0 - <br />
libulockmgr - 2.7.2-r2 - <br />
libupstart - 0.3.8-20 - <br />
libvolume-id - 115.2-25 - <br />
libvorbis - 1.2.0-r0 - <br />
libwps - 0.6.10-26 - <br />
libxml2 - 2.7.2-r3 - <br />
libxslt - 1.1.17-r7palm3 - <br />
logctld - 1.0-60 - <br />
logd-conf - 1.0.0-3 - <br />
luna-applauncher - 1.0-171 - <br />
luna-downloadmgr - 1.0-75.bw - <br />
luna-fonts - 1.0-20 - <br />
luna-fonts-cjkv - 1.0-2 - <br />
luna-fonts-prelude - 1.0-1 - <br />
luna-init - 1.0-66 - <br />
luna-keymap-headers - 1.0-14 - <br />
luna-keymaps - 1.0-70 - <br />
luna-media-shim - 1.0-27 - <br />
luna-network - 1.0-19 - <br />
luna-prefs - 1.0-60 - <br />
luna-service2 - 2.0.0-125 - <br />
luna-sysmgr - 1.0-861.bw.52 - <br />
luna-sysmgr-ipc - 1.0-25 - <br />
luna-sysservice - 1.0-117.bw - <br />
luna-systemui - 1.0-231.bw.1 - <br />
luna-universalsearchmgr - 1.0-29 - <br />
luna-webkit - 1.1-183.25 - <br />
lvm2 - 2.02.44-r2 - <br />
lvm2-config - 2.02.44-r2 - <br />
lvm2-static - 2.02.44-r2 - <br />
makedevs - 1.0.0-r2 - <br />
marvell8686microap - 1.0.0-9 - <br />
masflib - 1.0-10 - <br />
mdnsd - 107.6.0-9 - <br />
mediaadpcmdecodelib - 1.0.0-1 - <br />
mediacapture - 1.0-6 - <br />
mediaextension - 1.0-33 - <br />
mediametaserver - 1.0.0-6 - <br />
mediaserver - 1.2.0-394.14 - <br />
mediastream - 1.0-24 - <br />
mediasyncexporter - 1.0.0-13 - <br />
memchute - 1.0.0-19 - <br />
messaging.library - 1.0-1.2 - <br />
metascene.audiorecorder - 1.0-11 - <br />
metascene.base - 1.0-9 - <br />
metascene.photos.base - 1.0-6 - <br />
metascene.photos.crop - 1.0-2 - <br />
metascene.photos.full - 1.0-15 - <br />
metascene.photos.thumbs - 1.0-27 - <br />
metascene.slideshow - 1.0-14 - <br />
metascene.videos.base - 1.0-103 - <br />
metascene.videos.share - 1.0-66 - <br />
migrator - 1.0-10 - <br />
minicore2 - 1.0.1-29 - <br />
minidhcpd - 1.0.2-34 - <br />
mjson - 1.0-15 - <br />
mkbootfs-tools - 1.0-11 - <br />
mkimage - 1.1.2-r1 - <br />
mm-isp - 23.17M-r4 - <br />
mmscodec - 1.0-27 - <br />
mmsservice - 1.0-41 - <br />
mobilehotspotd - 1.0.1-46 - <br />
module-init-tools - 3.2.2-r3 - <br />
module-init-tools-depmod - 3.2.2-r3 - <br />
modutils-initscripts - 1.0-r2 - <br />
mojo - 1.0-367 - <br />
mojo.core - 1.0-32 - <br />
mojo2 - 1.0-98 - <br />
mojodb - 1.6-52.7 - <br />
mojodbshim - 1.0-3 - <br />
mojoloader - 1.0-34 - <br />
mojolocation - 1.0-54 - <br />
mojomail-common - 1.0-72 - <br />
mojomail-eas - 1.1-89.1.1 - <br />
mojomail-imap - 1.0-69 - <br />
mojomail-pop - 1.0-48 - <br />
mojomail-smtp - 1.0-39 - <br />
mojoservice.base - 1.0-57 - <br />
mojoservice.transport.base - 1.0-34 - <br />
mojoservice.transport.sync - 1.0-66 - <br />
mojoservicelauncher - 1.0.1-50 - <br />
mountcfs - 1.0-11 - <br />
mtools - 4.0.10-r0 - <br />
natool - 1.0.0-11 - <br />
ncurses - 5.4-r9 - <br />
net-tools-netstat - 1.60-r3 - <br />
netbase - 4.22-4 - <br />
network.alerts - 1.0-6 - <br />
node-ls2 - 1.0-10 - <br />
node-pmloglib - 1.0-3 - <br />
node-webos - 1.0-3 - <br />
nodejs - v0.2.3-17 - <br />
notes - 1.0-15 - <br />
novacom - 1.0-14 - <br />
novacomd - 1.0-81 - <br />
npapi-headers - 1.0-3 - <br />
npapiinterfacelib - 1.0.0-44 - <br />
ntpdate - 4.2.2p3-r1 - <br />
omadm - 1.0.0-145 - <br />
omxclientlib-omap34xx - 1.0.0-15 - <br />
ondevicedemod - 1.0.8-93 - <br />
ondevlogger - 1.0.0-5 - <br />
opencore-amr - 0.1.2-1 - <br />
opengles - 1.0.0-1 - <br />
opengles-omap3 - 1.0.0-1 - <br />
openssl - 0.9.8k-4 - <br />
ossinfo - 1.0.0-21 - <br />
ota-scripts - 1.2-17 - <br />
palmaacdemux - 1.0.0-27 - <br />
palmadpcmdecoder - 1.0.0-7 - <br />
palmamrdemux - 1.0.0-13 - <br />
palmaudiodecoder-omap34xx - 1.0.0-81 - <br />
palmaudioencoder-omap34xx - 1.0.0-32 - <br />
palmbuildinfo - 1.0.4-285 - <br />
palmcustomizationinfo-wr-castle-plus - 1.0-285 - wr-castle-plus Customization Info<br />
palmhttpsrc - 1.0.0-64 - <br />
palmjpgencsink-omap34xx - 1.0.0-59 - <br />
palmmp3demux - 1.0.0-99 - <br />
palmmp4mux - 1.0.0-72 - <br />
palmqcelpdemux - 1.0.0-19 - <br />
palmvibelib - 1.0-10 - <br />
palmvideodecoder-omap34xx - 1.0.0-67 - <br />
palmvideoencoder-omap34xx - 1.0.0-47 - <br />
palmvideosink-omap34xx - 1.0.0-84 - <br />
palmvoicecodec - 1.0-13 - <br />
palmvoicedecoder - 1.0-23 - <br />
palmvoiceencoder - 1.0-17 - <br />
parted - 1.8.8-r3 - <br />
passthrud - 1.0.8-68 - <br />
pbnjson - 1.0.1-38 - <br />
pdfadapter - 1.0.0-45 - <br />
photos - 1.0-303 - <br />
piranha - 1.2-90.1 - <br />
pma6updater - 1.0.0-5 - <br />
pmbtcontacts - 1.0.0-2.0.0.1 - <br />
pmbtengine - 1.0.0-2.0.0.11 - <br />
pmbtos - 1.0.0-2.0.0.1 - <br />
pmbtstack - 1.1.1-2.0.0.7 - <br />
pmbtstartup - 1.0.1-2.0.0.2 - <br />
pmcarrierdb - 1.0.0-27.5 - <br />
pmcasper - 1.0.0-20 - <br />
pmcertificatemgr - 1.0.0-21 - <br />
pmcertificatemgrservice - 1.0.0-22 - <br />
pmcertstore - 1.0.4-17 - <br />
pmeloop - 1.0.0-3 - <br />
pmklogd - 1.0.0-6 - <br />
pmlegacyhcilinklayer - 1.0.0-3 - <br />
pmlogctl - 1.0.0-7 - <br />
pmlogdaemon - 1.0.2-94 - <br />
pmloglib - 1.0.0-15 - <br />
pmmedia - 1.0.0-2.2 - <br />
pmmedia-omap34xx - 1.0.0-2.2 - <br />
pmmodemefslogger - 1.0.1-24 - <br />
pmmodeminfo - 1.0.0-39 - <br />
pmmodempower - 1.0-9 - <br />
pmmodemqxdmlogger - 1.0.0-7 - <br />
pmmodemupdater - 1.0.0-125 - <br />
pmnetconfiglib - 1.0.1-17 - <br />
pmnetconfigmanager - 1.0.5-141.2 - <br />
pmnetworking - 1.0.0-0 - <br />
pmnetworking-castle - 1.0.0-0 - <br />
pmstatemachineengine - 1.0.1-7 - <br />
pmtelephony - 1.0.0-1 - <br />
pmtelephony-msm6xxx - 1.0.0-1 - <br />
pmtpupdater - 1.0.4-39 - <br />
pmupdater - 1.0.1-146 - <br />
pmvoicecommand - 1.4-5.30 - This is the Voice command service<br />
pmvoicecommand-dede - 1.0-5.30 - Voice command German language pack file<br />
pmvoicecommand-engb - 1.0-5.30 - Voice command British English language pack file<br />
pmvoicecommand-enus - 1.0-5.30 - Voice command US English language pack file<br />
pmvoicecommand-eses - 1.0-5.30 - Voice command European (Castilian) Spanish language pack file<br />
pmvoicecommand-esmx - 1.0-5.30 - Voice command Latin American Spanish language pack file<br />
pmvoicecommand-frca - 1.0-5.30 - Voice command Canadian French language pack file<br />
pmvoicecommand-frfr - 1.0-5.30 - Voice command European French language pack file<br />
pmvoicecommand-itit - 1.0-5.30 - Voice command European Italian language pack file<br />
pmvpnacoal - 1.0.0-27 - <br />
pmvpndaemon - 1.0.1-45 - <br />
pmwanpppplugin - 1.0.0-22 - <br />
pmwifidriver - 1.0.1-2.0.0.1 - <br />
pmwifiservice - 1.0.1-2.0.1.11 - <br />
pmwirelesssystemframework - 1.0.0-52 - <br />
pmwsfdaemon - 1.0.0-14 - <br />
pmwsfwanblade - 1.0.0-135.5 - <br />
popt - 1.7-r4 - <br />
popvol - 1.0.0-7 - <br />
powerd - 1.0.0-273.5 - <br />
ppp - 2.4.3-r3 - <br />
procps - 3.2.7-r8 - <br />
psmisc - 22.2-r1 - <br />
pstree - 22.2-r1 - <br />
ptmalloc3 - 1.0-7 - <br />
pubsubservice - 1.0-90 - <br />
pulseaudio - 0.9.14-59.4 - <br />
pulseaudio-lib-alsa-util - 0.9.14-59.4 - <br />
pulseaudio-lib-auth-cookie - 0.9.14-59.4 - <br />
pulseaudio-lib-authkey - 0.9.14-59.4 - <br />
pulseaudio-lib-cli - 0.9.14-59.4 - <br />
pulseaudio-lib-iochannel - 0.9.14-59.4 - <br />
pulseaudio-lib-ioline - 0.9.14-59.4 - <br />
pulseaudio-lib-ipacl - 0.9.14-59.4 - <br />
pulseaudio-lib-packet - 0.9.14-59.4 - <br />
pulseaudio-lib-pdispatch - 0.9.14-59.4 - <br />
pulseaudio-lib-protocol-cli - 0.9.14-59.4 - <br />
pulseaudio-lib-protocol-native - 0.9.14-59.4 - <br />
pulseaudio-lib-pstream - 0.9.14-59.4 - <br />
pulseaudio-lib-pstream-util - 0.9.14-59.4 - <br />
pulseaudio-lib-socket-server - 0.9.14-59.4 - <br />
pulseaudio-lib-socket-util - 0.9.14-59.4 - <br />
pulseaudio-lib-strlist - 0.9.14-59.4 - <br />
pulseaudio-lib-tagstruct - 0.9.14-59.4 - <br />
pulseaudio-misc - 0.9.14-59.4 - <br />
pulseaudio-module-alsa-sink - 0.9.14-59.4 - <br />
pulseaudio-module-alsa-source - 0.9.14-59.4 - <br />
pulseaudio-module-cli - 0.9.14-59.4 - <br />
pulseaudio-module-cli-protocol-unix - 0.9.14-59.4 - <br />
pulseaudio-module-default-device-restore - 0.9.14-59.4 - <br />
pulseaudio-module-detect - 0.9.14-59.4 - <br />
pulseaudio-module-native-protocol-unix - 0.9.14-59.4 - <br />
pulseaudio-module-null-sink - 0.9.14-59.4 - <br />
pulseaudio-module-null-source - 0.9.14-59.4 - <br />
pulseaudio-module-palm-a2dp-provider-sink - 0.9.14-59.4 - <br />
pulseaudio-module-palm-policy - 0.9.14-59.4 - <br />
pulseaudio-module-rescue-streams - 0.9.14-59.4 - <br />
pulseaudio-module-suspend-on-idle - 0.9.14-59.4 - <br />
pulseaudio-module-volume-restore - 0.9.14-59.4 - <br />
pulseaudio-server - 0.9.14-59.4 - <br />
qt4 - 4.6.1-47.4 - <br />
rdxd - 1.0.3-118 - <br />
readline - 4.3-r4 - <br />
recovery-utilities - 1.0.0-10 - <br />
redbend - 2.1.1.13-2 - <br />
remote-adapter - 1.0-27 - <br />
remote-adapter-ipc - 1.0-13 - <br />
resizefat - 1.0.0-4 - <br />
rolegen - 1.0-10 - <br />
sersend - 1.0.0-6 - <br />
setcharge - 0.1-7 - <br />
setserial - 2.17-r1 - <br />
sfrwisprd - 1.0.0-9 - SFR Wi-Fi Hotspot Controller<br />
shutdownscripts - 1.0.0-29 - <br />
smartkey - 2.0-53.2.1 - <br />
smsservice - 1.0-30 - <br />
sp-smaps - 0.2.2-r0palm3 - <br />
sqlite3 - 3.6.20-r0 - <br />
sqlite3-palm-extension - 1.0-21 - <br />
storaged - 1.0.3-119 - <br />
strace - 4.5.19-r0 - <br />
sweatshop-wr-castle - 1.0-72 - Version 1.0-72 of package sweatshop-wr-castle<br />
sync.ui - 1.0-8 - <br />
sysfsutils - 2.0.0-r0 - <br />
sysstat - 9.0.1-r1 - <br />
systemsoundsloader - 1.0.0-24 - <br />
sysvinit - 2.86-40 - <br />
sysvinit-pidof - 2.86-40 - <br />
tar - 1.17-r1 - <br />
target - 1.0.0-r0 - <br />
target-castle - 1.0.0-r0 - <br />
tasks - 1.0-18 - <br />
tcpdump - 3.9.4-r3 - <br />
tellbootie - 1.0-3 - <br />
tidspbridge-extra - 23.17M-r5 - <br />
tidspbridge-lib - 23.17M-r1 - <br />
tidspbridge-module - 23.17M-r8 - <br />
tidspbridge-mpusamples - 23.17M-r0 - <br />
tiff - 3.7.1-r0 - <br />
til - 1.0.0-119.22 - <br />
timezone - 2009s-1 - <br />
tiopenmax - 23.17M-r2 - <br />
tiopenmax-aacdec - 23.17M-r3 - <br />
tiopenmax-aacenc - 23.17M-r2 - <br />
tiopenmax-audiomanager - 23.17M-r0 - <br />
tiopenmax-camera - 23.17M-r2 - <br />
tiopenmax-clock - 23.17M-r0 - <br />
tiopenmax-common - 23.17M-r0 - <br />
tiopenmax-core - 23.17M-r2 - <br />
tiopenmax-inst2 - 23.17M-r0 - <br />
tiopenmax-jpegdec - 23.17M-r1 - <br />
tiopenmax-jpegenc - 23.17M-r2 - <br />
tiopenmax-lcml - 23.17M-r3 - <br />
tiopenmax-mp3 - 23.17M-r1 - <br />
tiopenmax-nbamrdec - 23.17M-r1 - <br />
tiopenmax-pcmdec - 23.17M-r1 - <br />
tiopenmax-policymanager - 23.17M-r2 - <br />
tiopenmax-postproc - 23.17M-r2 - <br />
tiopenmax-prepostproc - 23.17M-r1 - <br />
tiopenmax-ram - 23.17M-r0 - <br />
tiopenmax-resourcemanager - 23.17M-r2 - <br />
tiopenmax-rmproxy - 23.17M-r2 - <br />
tiopenmax-videodec - 23.17M-r4 - <br />
tiopenmax-videoenc - 23.17M-r5 - <br />
tisgxgfx - L23.17M3-41 - <br />
tisocketnode-control-task - 23.17M-r0 - <br />
tisocketnode-conversions - 23.17M-r1 - <br />
tisocketnode-dfgm - 23.17M-r0 - <br />
tisocketnode-h264dec - 23.17M-r0 - <br />
tisocketnode-ipp - 23.17M-r1 - <br />
tisocketnode-jpegdec - 23.17M-r0 - <br />
tisocketnode-jpegenc - 23.17M-r1 - <br />
tisocketnode-mp3 - 23.17M-r0 - <br />
tisocketnode-mpeg4aacdec - 23.17M-r0 - <br />
tisocketnode-mpeg4aacenc - 23.17M-r0 - <br />
tisocketnode-mpeg4dec - 23.17M-r0 - <br />
tisocketnode-mpeg4enc - 23.17M-r0 - <br />
tisocketnode-nbamrdec - 23.17M-r0 - <br />
tisocketnode-pcmdec - 23.17M-r0 - <br />
tisocketnode-ringio - 23.17M-r1 - <br />
tisocketnode-usn - 23.17M-r1 - <br />
tisocketnode-vpp - 23.17M-r0 - <br />
touchpanel-measure - 1.0-3 - <br />
transcodeserver - 1.0.0-24 - <br />
trenchcoat - 1.1.1-102.3 - <br />
udev - 115.2-25 - <br />
underscore - 1.0-7 - <br />
unittest - 1.0-17 - <br />
update-modules - 1.0-r4 - <br />
update-rc.d - 0.7-r0 - <br />
updatedaemon - 1.0.1-211 - <br />
updatefsinfo - 1.2-r5 - <br />
uploadd - 1.0.1-35 - <br />
upstart - 0.3.8-20 - <br />
upstart-initscripts - 1.0-110 - <br />
upstart-sysvcompat - 0.3.8-20 - <br />
uriparser - 0.7.4-r0 - <br />
usbmon - 1.0-5 - <br />
usbnet - 1.0.0-1 - <br />
usbsniffd - 1.0.0-1 - <br />
util-linux-ng-blockdev - 2.14.2-r5 - <br />
util-linux-ng-ionice - 2.14.2-r5 - <br />
util-linux-ng-losetup - 2.14.2-r5 - <br />
util-linux-ng-mkswap - 2.14.2-r5 - <br />
util-linux-ng-swaponoff - 2.14.2-r5 - <br />
vibetonz - 1.0.0-4 - <br />
vibetonz-castle - 1.0.0-4 - <br />
vpnacagent - 1.0.0-35 - <br />
vpnc - 0.5.3-4 - <br />
vpncagent - 1.0.0-29 - <br />
watchdogd - 1.0.0-3 - <br />
webview - 1.0-23.1 - <br />
wireless-tools - 29-r2 - <br />
wirelesswhitebox-tiltest - 1.0-9 - <br />
wpasupplicant - 0.6.10-26 - <br />
xz-embedded - 1.0-1 - <br />
yajl - 1.0.7-3 - <br />
zeroconfigd - 1.0.0-13 - <br />
zlib - 1.2.3-r2 -</div>
Yannick56