Pandora Java In A Pnd?

WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,733
So I was able to extract all the java classpath, jre, and VM stuff and jam it all into a single file on my SD card from which I can now happily run Java programs. It is 139M in total and works fairly well. I played Dominion (awesome fun card game) via BrettspielWelt with no problem. No 3D stuff though
Any suggestions on ways to make this convenient for Johnny Everyman? I was thinking of packaging it into a PND which could be run once to "install" a /usr/bin/java file which is nothing more than a script of "pnd_run.sh /path/to/java.pnd $@" or something like that. Future classes and libraries can be uncompressed into the appdata directory. I don't know if that's a good idea or not.
Anyone interested can just download what I've got from here. Eventually. It's uploading, give it a half an hour or so.
 

Tempel

Active Member
Joined
Dec 30, 2008
Messages
670
Age
32
Website
randy.heydon.selfip.net
Uh oh. Your suggestion is getting dangerously in to the package manager territory that no one seems to have come to a consensus on when it comes to PNDs. Personally, I would leave it as a package that devs can use and add to their own Java-based PNDs. But at 139MB, that's a lot to include in every java-based PND. I'm conflicted.

But as PND dependencies go, I think your suggestion is pretty neat (run once to "install", run again to "uninstall", and keep all data in PND; just make sure your script is independent of mountpoint). However, it'd be nice if all PND dependencies could operate via a consistent mechanism, and I can't think of how this would work with, say, shared libraries. But hopefully others make suggestions. As long as we can come to an informal agreement on some sort of consistent PND dependency mechanism, I won't object.
 

sixela

Still Fresh
Joined
Dec 15, 2005
Messages
63
WizardStan said:
So I was able to extract all the java classpath, jre, and VM stuff and jam it all into a single file on my SD card from which I can now happily run Java programs. It is 139M in total and works fairly well. I played Dominion (awesome fun card game) via BrettspielWelt with no problem. No 3D stuff though
Any suggestions on ways to make this convenient for Johnny Everyman? I was thinking of packaging it into a PND which could be run once to "install" a /usr/bin/java file which is nothing more than a script of "pnd_run.sh /path/to/java.pnd $@" or something like that. Future classes and libraries can be uncompressed into the appdata directory. I don't know if that's a good idea or not.
Anyone interested can just download what I've got from here. Eventually. It's uploading, give it a half an hour or so.
Sorry to be a newb...I downloaded the file you mentioned.
Tried installing it with "sudo sh openjdk.sh" with no luck.
I have a feeling its because it is on my SD card. Is there a particular location the files have to be in?
 
Last edited by a moderator:

Tobriand

Very Active Member
Joined
Dec 27, 2002
Messages
4,071
Age
33
Location
Croydon (UK)
Website
Visit site
How about this:

- User places java files in directories in appdata.
- Simple launcher script is run whenever the PND is called providing a list of java applications detected inside SD:\\pandora\appdata\java
- Selecting an app runs it.
- Option of ticking apps and selecting install to self-modify the java pnd to be a multi-app pnd, where the other apps are those ticked to be installed (thus making the relevant apps show up on the desktop or menu or the like).

Not sure how to deal with extra libraries or classes, though...
 

WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,733
sixela said:
Sorry to be a newb...I downloaded the file you mentioned.
Tried installing it with "sudo sh openjdk.sh" with no luck.
I have a feeling its because it is on my SD card. Is there a particular location the files have to be in?
That's the point. It can be run anywhere. Just modify the "JAVA_HOME" variable in the openjdk.sh file to point to wherever you happen to put it on your SD and you can run it from the SD as if it were regular java.
Want to run a jar file? "openjdk.sh -jar JavaFile.jar".
Run just a straight class? "openjdk.sh -cp . MyClass".
Of course, this can only be done from command line at the moment, and requires that you modify the openjdk.sh file so it knows where to find itself. That's why I proposed an "install". The install would locate itself, modify the script, and then copy it to /usr/bin/java so that java programs can be run exactly as normal. Or something more complex, as needed. The only thing that would get copied to the NAND is that one tiny script, the remaining 139M remains on your SD card. The question is how to handle this kind of packaging.

Orion4874 said:
So this isn't a Java emulator like PhoneMe correct?
It's full Java, not ME. I tried a few applications from simple to full blown swing, and they all worked. Just the run time though, I haven't thought of how this would work with an applet plug-in. Also no 3D, that set of classes definitely needs to be rewritten.
 
Last edited by a moderator:

sixela

Still Fresh
Joined
Dec 15, 2005
Messages
63
Thanks Wiz! :)
WizardStan said:
sixela said:
Sorry to be a newb...I downloaded the file you mentioned.
Tried installing it with "sudo sh openjdk.sh" with no luck.
I have a feeling its because it is on my SD card. Is there a particular location the files have to be in?
That's the point. It can be run anywhere. Just modify the "JAVA_HOME" variable in the openjdk.sh file to point to wherever you happen to put it on your SD and you can run it from the SD as if it were regular java.
Want to run a jar file? "openjdk.sh -jar JavaFile.jar".
Run just a straight class? "openjdk.sh -cp . MyClass".
Of course, this can only be done from command line at the moment, and requires that you modify the openjdk.sh file so it knows where to find itself. That's why I proposed an "install". The install would locate itself, modify the script, and then copy it to /usr/bin/java so that java programs can be run exactly as normal. Or something more complex, as needed. The only thing that would get copied to the NAND is that one tiny script, the remaining 139M remains on your SD card. The question is how to handle this kind of packaging.

Orion4874 said:
So this isn't a Java emulator like PhoneMe correct?
It's full Java, not ME. I tried a few applications from simple to full blown swing, and they all worked. Just the run time though, I haven't thought of how this would work with an applet plug-in. Also no 3D, that set of classes definitely needs to be rewritten.
 
Last edited by a moderator:

skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,060
Website
www.codejedi.com
Short term seems okay though, no?

ie: have a java-launcher in yhour java-pnd, which just looks for subdirs of /pandora/appdata/javarun (or whatever) and lists the jar's or subdirs or some identifier in a menu, for runnig; this way the user can run an app without having to doctor files up or do any goofy stuff .. just like when running gargoyle or various games; pop up a simple zenity list of matches, pick one, run the pnd. pnd-run would gracefully handle multiple simultaneous runs already as well, so thats not even a problem.

Long term:

Its a tough one, for sure :) I always envisioned this sort of thing with a couple scenarios (that you've already thought of)..
1) put it into something like /pandora/autorun and on boot/insertion-of-sd the system would automatically pnd_run it and keep it there (with some menu item to 'unmount' all automounted pnds, or something. But this gets way too similar to fstab :)
2) menu items with stuff like 'activate' and 'deactivate' just as you say (essentially doing a pnd_run mount for one, and unmount for another, so the user coudl control the lifespan, without keeping a terminal or some placeholder open to keep pnd-run happy.)
3) pnd-run depdnancy; flag in the PXML that a pnd depends on another pnd, and when run pnd-run automatically runs dependancies and keeps them mountef for the duration; problem of course is when you run a few of these guys interleaves, it could become madness.

I forget if we still have a wall or not though; there was a time when we could only keep some 4 or 10 pnds open at once, though I forget if thats still an issue or not. (It might be a kernel build time or config time constraint, or maybe its not a constraint at all anymore.) If we still have a union count or loopback count limit, thats low, we would have to tread very carefully here, which is one of the things that lead me to just leave it until we could mull it over more :)

*shrug*
 

jdbye

Member
Joined
Dec 27, 2007
Messages
242
I'm interested in this, is it possible to make it work in Chromium or Firefox?
 

Bonbon-Chan

Still Fresh
Joined
Feb 5, 2009
Messages
23
JAM is very slow and need to install lots of package... The OpenJDK JRE is far faster and easier to install, but is less stable right now. I think that OpenJDK (only the JRE) is smaller too (I can't verify, my pandora is broken :( )
 

WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,733
Bonbon-Chan said:
JAM is very slow and need to install lots of package... The OpenJDK JRE is far faster and easier to install, but is less stable right now. I think that OpenJDK (only the JRE) is smaller too (I can't verify, my pandora is broken :( )
I tried JAM first because it was smaller and easier to setup. Unfortunately it was very slow and incomplete. It worked alright for command line stuff, but trying some SWING apps, either they failed for missing classes, or didn't display properly.
This is OpenJDK. It's faster as you say, but larger (not smaller) on account of being far more complete.
 
Last edited by a moderator:

mcobit

Advanced Member
Joined
Jul 28, 2008
Messages
6,910
Maybe we can have something to pack a program into a single file, like a pnd, just for javaprograms, so that you can choose them easily in a launcher.
Many programs consist of a lot of subdirs and jarfiles.
 

Bonbon-Chan

Still Fresh
Joined
Feb 5, 2009
Messages
23
WizardStan said:
I tried JAM first because it was smaller and easier to setup. Unfortunately it was very slow and incomplete. It worked alright for command line stuff, but trying some SWING apps, either they failed for missing classes, or didn't display properly.
This is OpenJDK. It's faster as you say, but larger (not smaller) on account of being far more complete.
Well for me, it was far longer to install JAM than to install OpenJDK-JRE (So I have the felling that JDK was smaller). I assume that you take the size of only the JRE and not the whole JDK.
You can make JAM work with AWT (and may be SWING), you have to install "classpath-gtk".

By the way, for nubs, I have ported JInput to pandora (Really easy to do) and I start to work on LWJGL (It seems that a team is working on it too). But since I have to send back my pandora :(, I can't work on it now.
 
Last edited by a moderator:

Morn

Member
Joined
May 13, 2010
Messages
292
Here's my problem:

I downloaded java.pnd and installed using menu item. I got java script in my /usr/bin, so far so good. Then I tried to run some of java apps from sebt3's packages, let's say gCalc.
..._run.out says:
Code:
/mnt/utmp/java/openjdk.sh: line 7: /mnt/utmp/java/openjdk/usr/lib/jvm/java-6-openjdk/jre/bin/java: Permission denied
So I glanced at /usr/bin/java and mounted java.pnd manually
Code:
/usr/pandora/scripts/run_pnd.sh -p /media/mmcblk0p1/pandora/menu/java.pnd -b java -m
next step was to check /mnt/utmp/java/openjdk/
It seems that all files there belong to user 1000 and the permissions to usr inside openjdk is 700

I tried mounting other pnds, e.g. gimp and it seems that files in /mnt/utmp/appname are always owned by 1000 so I'd guess the problem is with the lack of permissions. Is there a simple way to change them?
 

sebt3

homebrew player (P. & C.)
Joined
Sep 9, 2008
Messages
4,747
Age
39
Location
France
Website
sebt3.openpandora.org
Morn said:
I downloaded java.pnd and installed using menu item. I got java script in my /usr/bin, so far so good. Then I tried to run some of java apps from sebt3mcobit's packages, let's say gCalc.
Fixed that for ya :)
 
Last edited by a moderator:

mcobit

Advanced Member
Joined
Jul 28, 2008
Messages
6,910
I had that once before. Installing the java-pnd from menu again fixed it.
But other than that, did you somehow manage to install the javapnd as another user?
 

WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,733
The first squashfs package I uploaded had that (because I goofed). I thought I fixed that the next day though. When did you download the PND?
 
Top