Encapsulation of Java Apps - Easy as Pie!


You could post your complete runscript.


Would make it easier to help you.


Those lines should be ok.
 
Thanks!

This is my complete run script:


#!/bin/sh
export PATH="$PWD/bin:${PATH:-"/usr/bin:/bin:/usr/local/bin"}"
export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH:-"/usr/lib:/lib"}"
export HOME="$PWD" XDG_CONFIG_HOME="$PWD"
export QTDIR="$PWD"

java -jar /mnt/utmp/CGoban3/cgoban.jar


It didn't worked even though I placed the cgoban.jar file in the appdata folder. Then I tried changing the last command, and including the jar in the package:


java -jar cgoban.jar

It didn't worked either.

This is my PXML.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<PXML xmlns="http://openpandora.org/namespaces/PXML">

  <package id="cgoban-wrapper">

    <version major="1" minor="0" release="1" build="1" type="beta"/>

    <author name="Israel Rodríguez Nava" website="http://www.israel-rn.info"/>

    <titles>
      <title lang="en_US">CGoban 3</title>
    </titles>

    <descriptions>
      <description lang="en_US">CGoban 3 can connect to the KGS go server and can view and edit SGF (go game record) files.
      
      You need to download the cgoban.jar file from the server website: http://files.gokgs.com/javaBin/cgoban.jar </description>
    </descriptions>

    <icon src="cgobanicon.png"/>

  </package>


  <application id="cgoban3">
    <exec command="run.sh"/>

    <version major="3" minor="5" release="10"/> 

    <author name="William Shubert" website="http://www.gokgs.com"/> 
    
    <titles>
      <title lang="en_US">CGoban 3</title>
    </titles>
    
<descriptions>
  <description lang="en_US">CGoban 3 can connect to the KGS go server and can view and edit SGF (go game record) files.
  
  You need to download the cgoban.jar file from the server website: http://files.gokgs.com/javaBin/cgoban.jar </description>
</descriptions>


    <icon src="cgobanicon.png"/>

    <licenses>
      <license name="Other - proprietary" url="http://www.gokgs.com/tos.jsp"/>
    </licenses>

    <previewpics>
      <pic src="1.png"/>
      <pic src="2.png"/>
      <pic src="3.png"/>
      <pic src="4.png"/>
      <pic src="5.png"/>
      <pic src="6.png"/>
    </previewpics>


    <categories>
      <category name="Game">
        <subcategory name="BoardGame"/>
      </category>
    </categories>

    <associations>
      <association name="View SGF file" filetype="application/x-go-sgf" exec="-open %s"/>
    </associations>

    
  </application>

</PXML>
 
I changed the run script to:


#!/bin/sh
export PATH="$PWD/bin:${PATH:-"/usr/bin:/bin:/usr/local/bin"}"
export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH:-"/usr/lib:/lib"}"
export HOME="$PWD" XDG_CONFIG_HOME="$PWD"
export QTDIR="$PWD"

java -jar /mnt/utmp/cgoban-wrapper/cgoban.jar

and still not working.

The icon is correctly loaded, and the categories are properly read by the PND system. It's just the jar that doesn't load.
 
Then you have a problem with your PND. If it does not create the appdata folder, something is wrong. I will take a look at your script in more details later.
 
Last edited by a moderator:
The problem is, that you have capital letters in the path in your launchline.


The appdatafolder specified in the pxml is all lowercase...


Linux is case sensitive.


Use java -jar /mnt/utmp/cgoban3/cgoban.jar instead.
 
Last edited by a moderator:
The problem is, that you have capital letters in the path in your launchline.


The appdatafolder specified in the pxml is all lowercase...


Linux is case sensitive.


Use java -jar /mnt/utmp/cgoban3/cgoban.jar instead.
Already tried that.

Didn't work either.
 
Can you tell us what you see in the pndout file in the system tmp directory?
Sure.

Here it is:


=======================================================================================
PND : /media/PANDORA/pandora/apps/cgoban3.pnd
PND_FSTYPE : Squashfs
APPDATADIR : /media/PANDORA/pandora/appdata/cgoban3
APPDD_FSTYPE : vfat
PND_CPUSPEED : <unset>
EXENAME : run.sh
ARGUMENTS : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/cgoban3"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/PANDORA/pandora/appdata/cgoban3=rw+nolwh":"/mnt/pnd/cgoban3=rr" none "/mnt/utmp/cgoban3"
[sUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( run.sh ) ----------
/usr/pandora/scripts/pnd_run.sh: ./run.sh: /bin/sh^M: bad interpreter: No such file or directory
[ FAILED]--- Starting the application ( run.sh ) ----------
[ START ]--- Restoring the frame buffer status ----------
[sUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[sUCCESS]--- Waiting the Union to be available ----------
auplink:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
rmdir: failed to remove `/mnt/utmp/cgoban3': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[sUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[sUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 3




Thanks again for your help!
 
/usr/pandora/scripts/pnd_run.sh: ./run.sh: /bin/sh^M: bad interpreter: No such file or directory

Thats strange.

Why does it want to use /bin/sh^M

Should be /bin/sh

Is there some tab or space or something after #!/bin/sh in your startupscript and is the run.sh executable?

Edit:

Look here for fix:

http://www.linuxquestions.org/questions/slackware-14/bin-bash%5Em-bad-interpreter-no-such-file-or-directory-461400/

Do you edit the runscript and stuff on a WindowsPC?

If so, use notepad++. http://notepad-plus-plus.org/

If you use the editor that comes with windows. All kind of stupid stuff will happen if you want to run those files in Linux.
 
Last edited by a moderator:
Also  you shouldn't give the absolute path to the mounted PND in the runscript.  The folder the PND is mounted to can be specified at runtime,  so you can't always assume it will be the same.

When the PND is launched the active directory will already be the right one even if it isn't the one you anticipated so use this instead: 

java -jar cgoban.jar

- Neelix
 
Last edited by a moderator:
Hello,

I didn't use windows. I did the script and XML on a Mac, using Espresso (a code editor, mainly aimed at CSS).

But lately I've been editing directly on the Pandora, via Mousepad.

Neelix:

I used that path because I cannot include the jar into the package because of its license, so the user should download the jar from the official website, and put it on the appdata folder. Thus I need a script that looks for the jar file in that folder.
 
The Pandora does a union mount of the PND and the appdata directory. The working directory is automatically /mnt/utmp/<whatever> and everything that's in the PND and the appdata directory will just be there for you. Do as neelix says, it'll work.
 
Even if you don't use windows. The ^M character is your problem.
 
Hello.

Thanks everybody for your help, and to ekianjo for his guide in Pandoralive.

I fixed the lline breaks with Scintilla and now it works. I'll prepare a final package to upload it to the repo.

It's gonna be the first of many go apps capsules I'll be making... 

BTW, screenshots are not displaying on PND manager... is that normal?

Thanks again!
 
Back
Top