Beta Java Pnd


WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,731
java.pnd
The PXML contains two applications: install and uninstall. I recommend putting this pnd into /pandora/menu where it will put "Java install" and "Java uninstall" items into the System submenu. You could put it into /pandora/desktop, but then you'd just have two icons sitting on your desktop that never get used.
It really is as easy as hitting install. It copies a small executable to /usr/bin/java, and a small text file to ~/.javapnd containing the known location of the pnd so it doesn't have to go looking for it every time. For now (possibly forever) if you move the pnd, put it on a different card for example, you need to rerun the install program or manually edit ~/.javapnd; maybe at some point I'll make it smart enough that if it can't find it it'll try to look for it, but it's really not so hard to just run the install again, is it? Maybe set it up so multiple entries can be in the .javapnd and it tries each one. Does that sound like a good idea?
Anywho, I'd like some testing. Test the install, test the uninstall, test some jar files (after install, just run "java -jar file.jar" exactly as you would on a PC. Or even easier if it has a start script, just run the start script)

WARNING WARNING WARNING!
Even though I set HOME to the appdata directory, it still depends on the java app itself to respect this. An application that downloads or saves data may end up storing it on the firmware. I can't think of a global fix for this. Like other applications, it may have to be handled on a case by case basis, unless someone else has an idea.
 
Interesting, wonder how well this runs. Will be giving it a try once my Pandora returns from repair.
 
This works good. Some programs crash but that could be because of memory limitations or something. Will try to package an app in a pnd, that uses your java.pnd.

Will see how it'll work.

So, great work!
 
Very nice -

Can't try right now, but what version of java is this?

This is really cool - I have a couple of things I could release written in java, an mp3 player, a tetris clone, a genetic programming framework, other random crap....poker engine...the relative ease of java vs c++ :)
 
authoreyes said:
Can't try right now, but what version of java is this?
1.6.0_18, so fairly recent. OpenJDK is a few months behind the official Sun version, but it should be good enough for just about everything.

authoreyes said:
This is really cool - I have a couple of things I could release written in java, an mp3 player, a tetris clone, a genetic programming framework, other random crap....poker engine...the relative ease of java vs c++ :)
I'm actually kind of wary now that I've done it. Part of the beauty of the PND system is zero dependence. Provided you have at least the right version of the firmware, a PND should just work. Now that I've "opened the door" so to speak on Java apps, you can make a PND which relies on another PND, and you start back towards the dependency hell that PND tried to avoid. On the other hand, the alternative is including the Java runtime in every PND that uses it.
 
Last edited by a moderator:
WizardStan said:
I'm actually kind of wary now that I've done it. Part of the beauty of the PND system is zero dependence. Provided you have at least the right version of the firmware, a PND should just work. Now that I've "opened the door" so to speak on Java apps, you can make a PND which relies on another PND, and you start back towards the dependency hell that PND tried to avoid. On the other hand, the alternative is including the Java runtime in every PND that uses it.

Understood...and good point...

Hmm...what size is the runtime? Small enough to package with an app? That would actually be kinda cool, to have each pnd a standalone vm and app...

It's nice in that java has such a broad user base...It's not my favorite language, but it's relatively easy to become proficient in it. I know quite a few java devs who would be intrigued by having a portable device with the capabilities of the Pandora running java and a complete SDK/coding env.
 
Last edited by a moderator:
authoreyes said:
Hmm...what size is the runtime? Small enough to package with an app? That would actually be kinda cool, to have each pnd a standalone vm and app...
about 120MB uncompressed, but it zips up pretty good. If using squashfs, it brings it down to about 34MB.
 
Last edited by a moderator:
WizardStan said:
authoreyes said:
Hmm...what size is the runtime? Small enough to package with an app? That would actually be kinda cool, to have each pnd a standalone vm and app...
about 120MB uncompressed, but it zips up pretty good. If using squashfs, it brings it down to about 34MB.

I get your point, but I think the soulution with the shared java.pnd is much better!
These are additional 34 MB/File. If you have a program, that is 3 MB and you add the whole JRE it is completely overkill.
 
Last edited by a moderator:
Vimacs just reminded me ..

we did build in some basic 'dependancy' stuff to pnd_run.sh

I had thought we endlessly discussed it, but then didn't act on it yet (ie: the plan was to put some 'dependancy stuff' in PXML, a list of unique-id's depended upon, and then have libpnd search them out and fill them in for the invocation, so that an app could broascast it depended on 'java 123' and that'd get automounted for you.)

Turns out we did build some of that in pnd_run.sh, but I think it might've gotten stripped out now, so we shoudl really put that back in, and get the PXML-dependancy discussion back on the burner.

I didn't look at this yet, but presumably the 'java' script just mounts/unmounts the pnd as needed (which is fine), but if we end up with that and also for QT and anything else, we'll get a mess; so perhaps we shoudl get this back on the active discussion list ...

MY original propasition was just .. in PXML put in something like:

<dependancy>
<mount unique-id="java123" mountpoint="/mnt/utmp/java">
</dependancy>

Then libpnd would..
1) for .desktop, include the arguments (-j) to pnd_run in the command line
2) for direct invocations (like minimenu etc), it'd take care of it in similar fashion

This would eliminate the need for install/uninstall toggle-scripts and just let someone include a java123.pnd on their SD, and it'd get taken care of.

Risks I didn't mull over yet, maybe vimacs did .. if 3 jobs at once depend on the same pnd-file, does it work or explode? (ie: Do we need reference counting to know when one job exits, if it can unmount or not? But really, the system wouldn't allow an unmount if things still using the path, right..)

jeff
 
skeezix said:
and get the PXML-dependancy discussion back on the burner.
This one ?

skeezix said:
ie: Do we need reference counting to know when one job exits, if it can unmount or not? But really, the system wouldn't allow an unmount if things still using the path, right..
A simple trick here would be to mount a union-FS on top of the library-PND (as we already do for normal PND) and pnd_run.sh just create and hold a file in there in write mode (think "exec &3>$DIR/marker.$$"). So the union wont be umounted until the last pnd_run close that file
 
Last edited by a moderator:
skeezix said:
This would eliminate the need for install/uninstall toggle-scripts and just let someone include a java123.pnd on their SD, and it'd get taken care of.
That would work for PNDs, but the install/uninstall is still needed to download and run random jar files: java is not just a "library" like QT or whatnot, but is an application it its own right. That was my original intention: being able to download existing java applications and they'd run just the same as they would on a desktop. PNDing up certain java applications is extra functionality in this case.
 
Last edited by a moderator:
Well, file type associations do also work for applications contained in .pnd files.
you just need a .desktop with the proper mime association.

Actually, pxml has a feature for this.
<exec background="true" startdir="$PWD" standalone="false" command="java">
<associations>
<association name="Run Jar" filetype="application/java-archive" exec="-jar %s"/>
</associations>

or something along those lines should work for the java.pnd.

If you want to package a java app as a pnd you would just need to list java.pnd as a dependency(feture to come?) and have the pxml start a small shellscript containing "mimeopen your.jar".
Should work (tm)
 
WizStan -- shoudl add another option, another executable to the pnd, whose run-script just offers up zenity or picklelauncher to pick an arbitrary jar file to invoke?

Or maybe another install/remove option, that adds/removes a file association to .jar to the java app. Folks could do that manually in the xfce browser, too.

jeff
 
Actually that does run pretty well, I'm surprised. Cool :) Probably a big pile of jar's we coudl run here nicely :)

jeff
 
I'm hesitant to create a Run JAR gui because, quite frankly, I suck at guis. That's why I've been using zenity, but its usefulness will one day run out. In the meantime, I might be able to slap something together next week. Got busy plans this weekend and lots of work to do so I can make those plans happen.
 
just a 5 liner, zenity picker to pick a file, and then run it. piece of cake :)

No need for a serious gui, since we can build file-assoc's and dependancy stuff in sometime and its moto then..

Thanks though, fun stuff

jeff

.. but yeah, busy time of year .. crunch time :/ I'll be 'free' soon though .. hell-year ends!
 
Just to report something back:
Unfortunately some javaapps don't run good. Especially I tried TV-Browser and JDownloader. Both crash randomly. As I am not that much into Java I can't really read the debugmessages but i think it has something to do with RAM-limitations of the pandora. The FAQs of the programs say something about runnning with parameter -Xmx512M but we don't even have 512M of memory. Will mount some swap and try again. But maybe they just don't play well with OpenJDK.
 
skeezix said:
just a 5 liner, zenity picker to pick a file, and then run it. piece of cake :)

No need for a serious gui, since we can build file-assoc's and dependancy stuff in sometime and its moto then..

Thanks though, fun stuff

jeff

.. but yeah, busy time of year .. crunch time :/ I'll be 'free' soon though .. hell-year ends!
surely just bundling it with pickle launcher maybe? might try this tonight
 
Last edited by a moderator:
what about 'javaws'? for running jnlp?

For fun I randomly hit google for a MUD client, and Batmud's java client came up. Looks cute, but comes as a jnlp (web start) thing. Usually you run that with javaws (if not invoking from a browser.)

Hmm. Just looking for random cool java apps to run. Runescape would probably not work (needs jogl I bet.)

jeff
 
Back
Top