Using jPortable Launcher and jPortable JRE and it works with other jar files. However, I have a particular jar that needs to be told what other file to use for its purposes upon launch. So, in the same folder as that jar I put thenameofthe.jar.portable.ini and changed "thenameofthe" to the name of the jar. I then edited the ini and on the AdditionalParamaters= line added the name of the other file that the jar needs to use. What should happen is the jar then accesses that other file, runs a conversion on it, then saves the output to the final converted file. But, that's not happening... it's not creating that final output file. Based on the info I've read within the above-referenced ini file this should be working. So, at this point I'm not sure what the problem is. BTW: I know the jar file works because it did what it was supposed to do properly when I had java installed on the same PC. So, that's not the problem. It just seems to be that jPortable Launcher isn't passing along the parameter specified in the ini. Any ideas? Thanks!
You'll likely need the full path to the JAR file specified rather than a relative one. The working directory may be different than if you ran it directly. And you'll likely need quotes or similar depending on the JAR file path as if there are spaces it won't interpret it correctly.
Update: It looks like the current jPortable launcher doesn't set the working directory to the location of the JAR due to a bug whereas it did previously. Specifying the full path to the file should allow your JAR to work with the file.
Sometimes, the impossible can become possible, if you're awesome!
Thanks for replying. There are no spaces in the path or filename but, nevertheless, I tried adding the full path as is, enclosed within single quotes, and enclosed within double quotes to the AdditionalParamaters= line of the ini but none worked. Any further thoughts?
The java.exe call used by the launcher is as follows:
"$JavaPath\bin\java.exe" -Duser.home="$EXEDIR\Data\AppData" $strAdditionalParameters -jar "$JarPath"
You could try reconstructing this using a batch file with your local java to see what may be messing things up. The last time I looked at this a few years ago, using that order of parameters worked best. I'm unsure if that is still the case, though.
Sometimes, the impossible can become possible, if you're awesome!
Thanks for the suggestion. To anyone else who might find this topic while trying to resolve a similar issue, here's what worked for me:
In the example above, remove all the $ and use the full path to each file.
For the first portion within quotes, if pointing to the java.exe provided by jPortable JRE it would typically be within the CommonFiles\Java\ directory within whatever folder you use for your portable apps.
For the second portion within quotes, that's based on the jPortable Launcher folder. So, you'd enter the full path to it in front of \Data\AppData. However, if you're not using jPortable Launcher, you could actually specify any location you want.
Do NOT put the parameters next. It didn't work for me in that position. It had to be after the JarPath.
So, within the third set of quotes will be the full path to your jar file.
Lastly, after the name of your jar file in the step above, enter a space then the parameter you want passed to it. If the parameter happens to be another file you want your jar file to do something with then simply enter the full path to that file.
Put the complete command within an existing or new .bat file (aka batch file) to execute it. If you need help with batch files, you'll need to look elsewhere for that info. There's plenty on the internet.
Hope this helps.
Please try JavaPortableLauncher_6.0_Fix_Test_1.paf.exe to see if this fixes the issue for you.
Sometimes, the impossible can become possible, if you're awesome!