maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Instant Coffee - Packaging Java Applications for Fremantle (https://talk.maemo.org/showthread.php?t=51871)

Wonko 2010-05-04 19:07

Instant Coffee - Packaging Java Applications for Fremantle
 
Hi,

I started to package some Java applications to put these up in the repository.
The idea is to write scripts which allow the easy and reproducible creation of *.deb files for upload to the repository.
The scripts are available at https://garage.maemo.org/projects/instant-coffee/

So far I uploaded the Cambridge Software Labs version of the OpenJDK to extras-devel non-free (package name icedtea6) and Ant to extras-devel.
Reason for calling the OpenJDK version "icedtea6" is that the output of "java -version" reports it as "icedtea6".

I hope that everything is correct so far.
Especially licensing issues are not that easy to grasp.

Every feedback/support is highly appreciated.


Best regards

Wonko

Wonko 2010-05-04 20:58

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Added jline and clojure to extras-devel.

atnnn 2010-05-04 21:45

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
That's a great initiative, thanks.

Did you upload the binaries from the website or were you able to get the source and recompile it?

Specifically, it would be great to compile the browser plugin with a compatible version of libc++.

smoku 2010-05-04 22:02

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Why OpenJDK and non-free?
Isn't Sun Java fully open now?

Wonko 2010-05-04 22:22

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by atnnn (Post 643417)
That's a great initiative, thanks.

Did you upload the binaries from the website or were you able to get the source and recompile it?

Specifically, it would be great to compile the browser plugin with a compatible version of libc++.

I used the binaries from http://camswl.com

Quote:

Originally Posted by smoku
Why OpenJDK and non-free?
Isn't Sun Java fully open now?

I uploaded the JDK to non-free because only non-free allows to upload *.deb files directly.
I built all the packages using py2deb but for some reason the autobuilder did not like the package I set up for the JDK.
You can see the relevant build log here https://garage.maemo.org/builder/fre...log.FAILED.txt
As you can see in the control file I specified libpulse0 (>= 0.9.15~test5) as dependency but somehow the autobuilder did not pick up the .so file correctly.
Also specifying libpulse-dev did not help. So I decided to build the deb here in Scratchbox and go the way via non-free.

As for "really" compiling the whole thing from source: I simply don't have the time to figure this out at the moment. Afaik this involves quite some work to get even the "buildchain" required for building icedtea right.

MohammadAG 2010-05-04 22:26

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by Wonko (Post 643494)
I used the binaries from http://camswl.com


I uploaded the JDK to non-free because only non-free allows to upload *.deb files directly.
I built all the packages using py2deb but for some reason the autobuilder did not like the package I set up for the JDK.
You can see the relevant build log here https://garage.maemo.org/builder/fre...log.FAILED.txt
As you can see in the control file I specified libpulse0 (>= 0.9.15~test5) as dependency but somehow the autobuilder did not pick up the .so file correctly.

If you're sure the package works you might be able to remove dpkg-shlibdeps from debian/rules and see if it works in free.

mrebanza 2010-05-05 08:16

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Could adding Java Support to Maemo lead to running Android Apps Natively on the n900????

shiny 2010-05-05 08:23

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Many thanks! I'm most interested in this (as a fairly regular Java programmer when I'm not doing client-side work) and it'd be great to see Java stuff easily portable. There's another thread somewhere where someone has ported SWT, too. An installable combination of those two would be ideal from my perspective.

kevloral 2010-05-05 08:38

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by mrebanza (Post 644096)
Could adding Java Support to Maemo lead to running Android Apps Natively on the n900????

Not so easy. Android applications are written using the Java language syntax, but most of the API is different, as well as the bytecode format.

Wonko 2010-05-05 08:41

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by MohammadAG
If you're sure the package works you might be able to remove dpkg-shlibdeps from debian/rules and see if it works in free.

Thanks, I will try this.

Quote:

Originally Posted by mrebanza
Could adding Java Support to Maemo lead to running Android Apps Natively on the n900????

I have no clue what is necessary to run Android Apps.
Maybe you find an answer in the following thread:
http://talk.maemo.org/showthread.php?t=37405
Or, if you are sure there is no other thread about that yet, open a thread about running Android Apps on the N900 yourself.
This thread has the focus on packaging Java applications.

Quote:

Originally Posted by shiny
There's another thread somewhere where someone has ported SWT, too. An installable combination of those two would be ideal from my perspective.

That someone would be me ;)
I'm working on packaging that one too.

rash.m2k 2010-05-05 08:47

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
What would probably be better is a script to automatically download and install the embedded sun version of java for ARM - that way we just just click to re-install it once the trial runs out.

I have got opera mini running on my N900 and it would be great if there was a script to download and install everything for us.

joppu 2010-05-05 08:48

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Does this support Java 2 Micro Edition?

shiny 2010-05-05 09:01

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by Wonko (Post 644137)
That someone would be me ;)
I'm working on packaging that one too.

You know what? I wrote that reply on the bus (on my N900, of course) and then it occurred to me after I'd sent it that it probably was, and I'd made an idiot of myself :) And I was right :D

Sounds fantastic, anyway - look forward to testing it all out sometime :)

Wonko 2010-05-05 17:15

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by rash.m2k
What would probably be better is a script to automatically download and install the embedded sun version of java for ARM - that way we just just click to re-install it once the trial runs out.

I have got opera mini running on my N900 and it would be great if there was a script to download and install everything for us.

Well I don't know what license and/or legal issues this implies.
So for me I do not plan to write such a script like you describe it nor do I plan to package this version.

Quote:

Originally Posted by joppu
Does this support Java 2 Micro Edition?

You might want to have a look at http://www.microemu.org/
Also have a look at the general Java thread http://talk.maemo.org/showthread.php?t=37405
I think MicroEmulator got also discussed in that thread.
But please do not discuss the details in here as this thread is only about packaging Java applications.

Quote:

Originally Posted by shiny
You know what? I wrote that reply on the bus (on my N900, of course) and then it occurred to me after I'd sent it that it probably was, and I'd made an idiot of myself And I was right

Hehe, I know that feeling. I'm sometimes not so good in remembering names either. ;)

Wonko 2010-05-05 19:19

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Alright,
icedtea6 is now in the free repository (thanks again to MohammadAG for the hint) and I promoted the packages uploaded so far to testing.

mikec 2010-05-05 19:48

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Any chance you can package up a simple java app that has icedtea as a dependancy. Then all i need to do is intall app and the whole java stack gets bootstrapped in:D

kamishly 2010-05-05 19:56

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Does it support a Java Applet?

Is there a chance to have it?


Quote:

Originally Posted by Wonko (Post 643103)
Hi,

I started to package some Java applications to put these up in the repository.
The idea is to write scripts which allow the easy and reproducible creation of *.deb files for upload to the repository.
The scripts are available at https://garage.maemo.org/projects/instant-coffee/

So far I uploaded the Cambridge Software Labs version of the OpenJDK to extras-devel non-free (package name icedtea6) and Ant to extras-devel.
Reason for calling the OpenJDK version "icedtea6" is that the output of "java -version" reports it as "icedtea6".

I hope that everything is correct so far.
Especially licensing issues are not that easy to grasp.

Every feedback/support is highly appreciated.


Best regards

Wonko


Wonko 2010-05-06 09:06

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by mikec (Post 645087)
Any chance you can package up a simple java app that has icedtea as a dependancy. Then all i need to do is intall app and the whole java stack gets bootstrapped in:D

Unfortunately I am quite short of time at the moment.
But you can also start packaging yourself. Just have a look at the package scripts in the Instant Coffee Subversion
https://garage.maemo.org/scm/?group_id=1578
If it is "just" a common Java application with no other dependencies than Java itself, packaging it should be straight forward.

Quote:

Originally Posted by kamishly
Does it support a Java Applet?

I dont't really know what you mean.
I tested to run an Applet as application using the sample code from http://www.wutka.com/hackingjava/ch1...sanApplication and it basically works.
Don't know though if it's that what you mean.
Also please note that this thread is supposed to be about packaging and not discussing Applets.

shiny 2010-05-06 09:24

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Well, basic programs certainly work. Just installed icedtea6, wrote a quick class in the Terminal, compiled and ran it. Excellent :)

Wonko 2010-05-08 17:20

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Inspired by this article http://maemoarena.com/2010/05/nokia-...emoed-in-n900/ I added MicroEmulator.
Also I added my own to-do list application To-Do-O ;)

antoarts 2010-05-08 17:34

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Applications will probably use the default Java theme and be non-fingerfriendly, and there is no hildon (or something similiar, with mobile components) for Java so Java will still not be a good language to code maemo apps in...?

But great to see someone doing something about the Java support!

Wonko 2010-05-08 17:54

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by antoarts (Post 649575)
Applications will probably use the default Java theme and be non-fingerfriendly, and there is no hildon (or something similiar, with mobile components) for Java so Java will still not be a good language to code maemo apps in...?

"Native" (read "Native as meaning Swing or AWT) Java applications probably have that problem, right.
For SWT Java applications I made an swt-hildon port.
http://talk.maemo.org/showthread.php?t=40778
This gives you at least some "hildonization" and touch UI controls.
In the SWT thread there are some posts which explain what has been added so far.

Wonko 2010-05-15 11:40

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Alright,
had some time and packaged up IcedTea 1.8 from debian packages for maemo.
This new version is currently in extras-devel.

The major difference is that this new version also includes a JIT while the old version was operating only in interpreted mode.
I don't have the time for benchmarking etc. so I can't tell how these versions compare performance-wise.
It would be great if you let me know how this works for you.

One benefit of the new version of course is that it includes all bug and security fixes of the last years.

shiny 2010-05-19 14:42

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
In case anyone's interested, there's a screenshot of a Java/SWT app running on my blog (plus some OpenLazarus, too).

Wonko 2010-05-22 21:42

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
For those of you programming Clojure:
I added clojure-contrib and a script that I got from http://gist.github.com/407622 which gives you a nicely colored REPL (I called the package "clojure-color-repl") to extras.

shiny 2010-05-26 09:38

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
You may be interested (although not surprised) to know that To-Do-O and icedtea6 seem to work fine under PR1.2 :)

Wonko 2010-06-01 19:40

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by shiny (Post 678679)
You may be interested (although not surprised) to know that To-Do-O and icedtea6 seem to work fine under PR1.2 :)

Hey, (I am a little bit late) but thanks for your testing. :)

As another news, you might be interested that, thanks to the brave testers, the 1.5 version of icedtea6 finally got 10 thumps up and I promoted it to extras. :)

torshind 2010-06-03 21:10

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Wonko,
I upgraded to icedtea6 1.8 and now Opera Mini with Microemulator doesn't work anymore... It's just me?

Wonko 2010-06-04 11:10

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by torshind (Post 698382)
Wonko,
I upgraded to icedtea6 1.8 and now Opera Mini with Microemulator doesn't work anymore... It's just me?

Thanks for the info.
Will have a look at it.

Wonko 2010-06-05 08:27

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
I uploaded a new version (1.8-4) which hopefully fixes the problem.
Just let me know if it works for you now.

torshind 2010-06-05 21:16

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
1 Attachment(s)
Quote:

Originally Posted by Wonko (Post 700760)
I uploaded a new version (1.8-4) which hopefully fixes the problem.
Just let me know if it works for you now.

No, same problem. Maybe it's just a problem in my configuration, microemulator doesn't crash but the midlet execution is suspended (see screenshot). Microemulator demo midlet works fine.

lagerspetz 2010-06-11 07:23

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
You made the icedtea6 package also?
For Java GUI support, the Jalimo project has packages for the SWT. For deployment, you could use debian packages. the Jalimo page describes a maven plugin to make deb packages. The Jalimo SWT looks native and works well for me.

If you include the files from the SWT JNI package in jre/lib/arm and the jars from the SWT package in jre/lib/ext (both can be found here), SWT-based GUI apps work with java -jar. This Java developers can put into .desktop files in debian packages.
I have made this Java app that assumes java is in the path and swt installed. It works after the install of the Jalimo SWT example from here (Single Click Install link).

I have also tested it with an optified openjdk from debian sid, and your icedtea6. Both seem to be good as long as the Jalimo SWT is installed. The Jalimo virtual machine however uses GNU Classpath, and is not fully compatible with Sun's class library; for example HTTP connections do not support chunking.

So in my view, the best possible Java we can have is icedtea6 + SWT from the Jalimo project. For the Java web plugin, I don't know how to proceed.

P.S. I also tried microEmulator, but it seems my MIDlet never creates any other commands than Quit in it, and keys also seem to do nothing. It's like the microEmulator virtual phone is active, but the MIDlet UI inside it is frozen.

Wonko 2010-06-12 23:34

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by torshind (Post 701608)
No, same problem. Maybe it's just a problem in my configuration, microemulator doesn't crash but the midlet execution is suspended (see screenshot). Microemulator demo midlet works fine.

Hmm, I see.
Unfortunately I am really short of time at the moment so I don't know when I can have a look at this issue.


Quote:

Originally Posted by lagerspetz
...
So in my view, the best possible Java we can have is icedtea6 + SWT
...

I also ported SWT to Fremantle and the Hildon UI.
It initially started of from the patch the Jalimo project provided for an older SWT version.
Now the SWT port has far more capabilities and much better integration into the Hildon UI like touch UI controls, native Hildon dialogs etc.
You can even use the SWT browser widget if you have fennec installed.

For more details see:
http://talk.maemo.org/showthread.php?t=40778
http://maemo.org/packages/view/libswt-hildon
https://garage.maemo.org/projects/swt-hildon

lagerspetz 2010-06-13 20:21

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Hi,
Quote:

Now the SWT port has far more capabilities and much better integration into the Hildon UI like touch UI controls, native Hildon dialogs etc.
You can even use the SWT browser widget if you have fennec installed.
Yes, I tried your SWT before, but it may be that I downloaded a wrong one, since it looked out-of-place. I tried again after reading your reply, and now it sure enough looks great, and seems even faster than the Jalimo one. I'll proceed to let go the Jalimo repository altogether, this seems to work well for me.

Thanks for the fantastic work! I will make my projects depend on your libswt-hildon.

One more question: Why is icedtea6 not in /opt/maemo/usr/lib/jvm, /opt/usr/lib/jvm, or some such ?

jayford 2010-06-26 14:50

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
With OpenJDK being in the repository and (partly?) working, is it possible right now/in the future to develop applications to Maemo using Java Qt?

Wonko 2010-07-05 21:20

Re: Instant Coffee - Packaging Java Applications for Fremantle
 
Quote:

Originally Posted by jayford (Post 730232)
With OpenJDK being in the repository and (partly?) working, is it possible right now/in the future to develop applications to Maemo using Java Qt?

As what I can say the plain JDK is fully working.

With respect to Java and Qt:
There is Qt Jambi, which, in short, provides Qt functionality in Java.
The problem is that Qt Jambi is not officially supported anymore.
Though, there are some Open Source efforts to port/maintain Qt Jambi for newer Qt versions.

Also, I do not know if Qt Jambi will work with the Maemo Qt version.
What I can say from my experiences with SWT is that such efforts for supporting a native UI toolkit in Java typically involve JNI or JNA.
Hence, you would basically have to "port" at least the native component to the N900.
This requires e.g. the compilation of the native parts for the ARM target.


Edit:
Quote:

Originally Posted by lagerspetz (Post 713578)
One more question: Why is icedtea6 not in /opt/maemo/usr/lib/jvm, /opt/usr/lib/jvm, or some such ?

Well, if I recall correctly, I did it this way because it was easier to package in a distinct directory.
For more details you can have a look at the instant coffee garage project site and the sources of the packaging scripts there.


Regards

Wonko


All times are GMT. The time now is 02:14.

vBulletin® Version 3.8.8