You are here

Help with Java app portability

5 posts / 0 new
Last post
Ken Herbert
Ken Herbert's picture
Offline
Last seen: 8 hours 6 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
Help with Java app portability

Hey folks,

I'm in the process of making my first Java-based portable app, but Java as a platform is not a strong point for me. I seem to have come across something that isn't handled in the launcher manual, either that or I'm just not reading it correctly (always a possibility).

First of all, the app in question is Makagiga. I am using version 3.8.13 Portable/Cross-Platform purely because version 4 uses Java 7, for which there is currently no portable version.

How it works in portable mode is it has a .bat file (and a .exe which I am assuming does exactly the same thing), containing the following:
java -Xverify:none -Xms16m -Xmx128m -jar makagiga.jar -portable "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"

And here is my current launcher.ini for reference:

[Launch]
ProgramExecutable=Makagiga\run-portable.exe
DirectoryMoveOK=yes
WaitForExe1=javaw.exe

[DirectoriesMove]
portable=%PAL:AppDir%\Makagiga\portable

My problem is that the base app runs fine, but running from the launcher I receive the following from the JVM:

Error: Unable to access jarfile makagiga.jar

I tried the thing with Process Explorer, but the only .exe running that would be applicable was javaw.exe.
Also tried the Eclipse-based command line, but it did not work either.

Any assistance would be greatly appreciated.

depp.jones
Offline
Last seen: 1 day 5 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Try to add

Try to add WorkingDirectory=%PAL:AppDir%\Makagiga.
I don't know if that's enough for this app, but it should fix this problem.

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 8 hours 6 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
Thanks, this worked great,

Thanks, this worked great, although I will go with kAlug's solution below as it takes one less step to get things running by having pAppsLauncher -> javaw.exe instead of pAppsLauncher -> run-portable.exe -> javaw.exe.

Once, again, thanks for the help though.

Aluísio A. S. G.
Offline
Last seen: 8 years 4 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Native Java support
[Launch]
ProgramExecutable=javaw.exe
CommandLineArguments=-jar "%PAL:AppDir\Makagiga\makagiga.jar" -Xverify:none -Xms16m -Xmx128m -portable

Previously known as kAlug.

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 8 hours 6 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
Thanks, this did what I

Thanks, this did what I needed once I added
[Activate]
Java=require

Will post the Dev test once I have made sure paths are handled properly.

Thanks again.

Log in or register to post comments