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

Update September 10th, 2013

- HOME has been fixed to write to the appdata directory by default for a while now, so no longer any fear of saving stuff to NAND. If you call "java" directly, "HOME" is the java appdata directory, but if it is called within a PND then HOME is the PNDs appdata directory. Easy peasy.

- javac is now included with the Oracle Java. It installs javac with the openJDK as well, but it'll just popup a warning saying that OpenJDK compiler doesn't work on ARM yet.

- Oracle Java is updated to 1.7.0_21. If you haven't yet, delete the jdk directory in your appdata/java directory and it'll pick up the new one automatically.
 
Last edited by a moderator:
I would say that based on what mcobit has been doing the past few days it is simple. Thank you WizardStan I know alot of people wanted this.
 
A quick inspection reveals that they're using a custom cursor which need to be handled properly. Cursors for windows are 32x32, cursors for X11 (Linux) are 16x16. If the JVM creates a 16x16 cursor (as it is on the Pandora) but the developer assumes that the cursor is 32x32 (because they assume Windows or don't realize there's a difference) then they'll get an IndexOutOfBoundsException. Java does have a function "getBestCursorSize" which will return the proper cursor size, but only if the developer uses it.


The only way to fix this is to get the source (which is available) and change it to use getBestCursorSize instead of assuming 32x32 (I think), which I may do tonight for you.


Java: it's only cross platform if you use it right (which is 99% of the time)
 
I hope the gods of this forum don't crush me for hijacking this thread, but there is a german "dev" that tries to bring Nightvision to the Pandora, but after starting it directly from the commandline he gets the error:



Code:
Exception in thread "main" java.lang.NoClassDefFoundError: java/beans/PropertyChangeListener

...

Could not find the main class: com.nvastro.nvj.Nvj. Program will exit.


Maybe anyone could help him out ?


Link to the thread in the german board
 
I downloaded F_Slim's PND and (un)fortunately it runs perfectly.


The error that was listed is that it can't find the main class in the jar file. I wonder if he made a mistake in the original PND file, fixed it and reuploaded, but not before jhw had already downloaded the broken version, not realizing there was an update. I'd suggest to jhw to try downloading again, because it seems to be running great on my Pandora. This is a pretty slick app, and F_Slim has my thanks for it :)


I would report all this myself, but my German is pretty poor, I'd have to use google translate and that never goes well.
 
hi


seemed to have installed okay but when trying to run the nightvision pnd get this (i run os off sdcard):


-------


sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/PANDORA1/pandora/menu/apps//java.pnd -e instjava.sh -b java


not mounted on loop yet, doing so


LoopMountedon:


/dev/loop3


Filetype is Squashfs


Mounting PND (mount -t squashfs) :


/dev/loop3 on /mnt/pnd/java type squashfs (ro)


Filesystem is vfat


Mounting the Union FS using /media/PANDORA1/pandora/appdata/java as Write directory:


mount -t aufs -o exec,noplink,dirs=/media/PANDORA1/pandora/appdata/java=rw+nolwh:/mnt/pnd/java=rr none /mnt/utmp/java


none on /mnt/utmp/java type aufs (rw,si=67327437,noplink)


none on /mnt/utmp/java type aufs (rw,si=67327437,noplink)


[------------------------------]{ App start }[---------------------------------]


find: `/media/PanBoot1/lost+found': Permission denied


find: `/media/PanBoot1/home/root/.cache': Permission denied


find: `/media/PanBoot1/home/root/.local/share': Permission denied


find: `/media/PanBoot1/home/root/.config': Permission denied


find: File system loop detected; `/media/PanBoot1/media' is part of the same file system loop as `/media/'.


find: `/media/PanBoot1/etc/polkit-1/localauthority': Permission denied


find: `/media/PanBoot1/var/volatile/run/NetworkManager': Permission denied


find: `/media/PanBoot1/var/lib/polkit-1': Permission denied


find: `/media/PanBoot1/pandora/appdata/op_nubmode/.wh..wh.plnk': Permission denied


find: `/media/PanBoot1/pandora/appdata/op_usermanager/.wh..wh.plnk': Permission denied


find: `/media/PanBoot1/pandora/appdata/op_wifi/.wh..wh.plnk': Permission denied


find: `/media/PanBoot1/pandora/appdata/op_cpuspeed/.wh..wh.plnk': Permission denied


find: `/media/PanBoot1/pandora/appdata/op_cpusettings/.wh..wh.plnk': Permission denied


find: `/media/PanBoot1/pandora/appdata/op_datetime/.wh..wh.plnk': Permission denied


find: `/media/PanBoot1/pandora/appdata/op_lcdsettings/.wh..wh.plnk': Permission denied


Found /media/PANDORA1/pandora/menu/apps/java.pnd


[-------------------------------]{ App end }[----------------------------------]


cleanup done


-------------


and this for nightvision:


sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/PANDORA1/pandora/menu/apps//nightvision.pnd -e ./start_nvj.sh -b nightvision


not mounted on loop yet, doing so


LoopMountedon:


/dev/loop7


Filetype is ISO


Mounting PND (mount) :


/dev/loop7 on /mnt/pnd/nightvision type iso9660 (ro)


Filesystem is vfat


Mounting the Union FS using /media/PANDORA1/pandora/appdata/nightvision as Write directory:


mount -t aufs -o exec,noplink,dirs=/media/PANDORA1/pandora/appdata/nightvision=rw+nolwh:/mnt/pnd/nightvision=rr none /mnt/utmp/nightvision


none on /mnt/utmp/nightvision type aufs (rw,si=67327437,noplink)


none on /mnt/utmp/nightvision type aufs (rw,si=67327437,noplink)


[------------------------------]{ App start }[---------------------------------]


Found java.pnd at /media/PANDORA1/pandora/menu/apps/java.pnd


sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/PANDORA1/pandora/menu/apps/java.pnd -b java -m


not mounted on loop yet, doing so


LoopMountedon:


losetup: could not find any free loop device


usedminor 7


freeminor 8


Filetype is Squashfs


Mounting PND (mount -t squashfs) :


/dev/loop8 on /mnt/pnd/java type squashfs (ro)


Filesystem is vfat


Mounting the Union FS using /media/PANDORA1/pandora/appdata/java as Write directory:


mount -t aufs -o exec,noplink,dirs=/media/PANDORA1/pandora/appdata/java=rw+nolwh:/mnt/pnd/java=rr none /mnt/utmp/java


/sbin/mount.aufs:mount.aufs.c:191: .: Stale NFS file handle


The Union File-system is not mounted !


The Union File-system is not mounted !


/usr/bin/java: line 21: /mnt/utmp/java/openjdk.sh: No such file or directory


shell-init: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


shell-init: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Stale NFS file handle


cleanup done


[-------------------------------]{ App end }[----------------------------------]


cleanup done
 
hmmm... "Stale NFS file handle" is the pertinent error. It mounts the PND just fine, but then it tries to union mount the appdata directory and fails. I can't seem to find any information on this other than someone suggesting that the shell has cached some out of date inode data for something that has changed.


I'm going to fall back to the age old "try turning it off and on again"


Something has got the filesystem a little out of whack and that's the easiest way I can think of to fix it.
 
hmmm... "Stale NFS file handle" is the pertinent error. It mounts the PND just fine, but then it tries to union mount the appdata directory and fails. I can't seem to find any information on this other than someone suggesting that the shell has cached some out of date inode data for something that has changed.


I'm going to fall back to the age old "try turning it off and on again"


Something has got the filesystem a little out of whack and that's the easiest way I can think of to fix it.

NOOOOOOOOO!!!!
the-it-crowd-s1e1-customer-support_200x113.jpg



on a more serious note I am running HF5 known to have problems mounting stuff, are you running HF5 as well?
 
I'm still on HF4. Don't want to upgrade until the whole "can't get GCC on HF5" thing is fixed.
 
Do you think that you could make it auto-detectable by firefox?


It is pretty close to have more working stuff than I have on my regular desktop: both java and flash at the same time in firefox :)
 
I ran into this problem today when trying to run the Scientific Calculator from the app store,


I ended up getting it to work by taking this from the pndrun_JavaScientificCalculator.out file..



Code:
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/PANDORA/pandora/menu/java.pnd -b java -m

(/media/PANDORA/pandora/menu/java.pnd is the path to the java.pnd file on my sd card)


and then running it in the terminal,


this created the /mnt/utmp/java folder and after that the scientific calculator program worked fine
 
Ah, finaly I found it, I knew that there must be a JAVA .PND somewhere. ;) I missed it in the Repo and the App Store doesn't had any informations about that file. And EDs Archive search function doesn't seem to work correctly at the moment, so I had to ask google. :D


Which Version is this actualy and are there newer/faster Versions available that could speed up Java Apps on the Pandora?


I would try some Java Games and I hope the Pandora is fast enough for this. Notch made a little Browser based 3D Dungeon Crawler, plays well on my PC but I guess it is not that easy on the Pandora?


http://s3.amazonaws.com/ld48/index.html


And does this PND also installs Java itself on the SD or is only it's appdata on the SD Cards? I ask because I have to enter my password. But it seems to work even when I abort this dialouge. Weird, happend sometimes and I remember it messed up everything. These dialogs on the Pandora show really no mercy - Abort/cancel? - No chance! :lol:


EDIT: Damn, it really wants to put everything on the NAND. :( Sorry, no chance, my NAND stays as clean as possible. I would like to see a version that installs Java completely on the SD card.
 
Last edited by a moderator:
Actually, it does. It just installs a config file to the NAND that redirects Java usage to the PND itself.
 
Actually, it does. It just installs a config file to the NAND that redirects Java usage to the PND itself.
Ah, OK.


Would be cool if this was more clearly described during the installation, so people like me are no longer scared to death. :rolleyes:


Edit: I guess I have it installed, but websites still say, I require java. :( Tested in Midori and firefox, all plugins enabled. Normaly this works on the PC but it seems not on the Pandora.
 
Last edited by a moderator:
This doesn't work anymore since HF6. It says an unrecoverable error happened, and I should reinstall, which I did several times.
 
This doesn't work anymore since HF6. It says an unrecoverable error happened, and I should reinstall, which I did several times.
pnd_run.sh has changed in HF6. It seems to override the $HOME variable before executing the application. The original home directory should be set in $REAL_HOME. I'm not sure, but this may be the cause of this application failing to run properly.
 
Back
Top