Hello everyone
Although i'm a portable applications fan i'm quite new at this developing stuff. I've found a couple of java applications (simple jar files) which i found interesting. I've been thinking about how I can turn this Java apps into portableapps.com format.
However, I imagine I am not the first who thought in this so I wanted to know how can I do (using the portableapps.com way) to find and load the javaw.exe. Once I get the path the rest is quite easy.
I'm such a newbie in nsis script developing... anyway I wanted to share what i thought of. I've been thinking in storing the javaw.exe path into settings.ini optionally. In case it isn't there i could look for it in $EXEDIR/jre/bin/javaw.exe and, as a last alternative using the env variable.
How do you usually solve this issue? What do you do if java isn't even installed?
It would be great if someone could post a generic nsis script which does something like this...
Thanks for taking the time for reading
I forgot where it's posted, but you should look into using the PortableApps\Commonfiles\Java directory since that will be the location of Java within the PortableApps directory structure.
I remember seeing an NSI script on here that looked for java.exe in some common places, but I don't know where it is. Search this forum or the Beta forum.
Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!
I think you mean Klonk's Portable Application Template, now at v2.1. It's in this forum.
I found this java_readme.txt in .\PortableApps\OpenOfficePortable\App\Java
To run javaw.exe from the menu you'd still have to use nsis or find some other way getting the link to it in the menu. I managed a little utility that runs a generic batch file called run.bat using shellexec, so I put this thing in the proper directory and make a run.bat file to launch whatever, but after all that I did the same thing with nsis in half the time, and honestly with a little study from these forums and the help files, nsis was easier.
Hope it helps
Have an Awesome Day!
Yeah, that was it. Having a portable Java for OpenOffice enables the wizards to work.
The readme you found is a little dated however. John actually coded a nice little program to do the Java copying to the right place and it creates the .ini file too.
Read this right here:
https://portableapps.com/support/openoffice_portable#java
Point being that once Java is on someone's portable device, you could launch .jar files with something as simple as a batch file as long as it pointed to the right directory where Java is at. Coding an NSI file to look for java.exe in a few common places would be "slicker" I suppose.
Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!
Phex (http://www.phex.org) is a Open Source (GPL) Gnutella client, written in java and working very well. It supports already the
-c ./Data
command line switch to store all settings and downloads in a relative path in programs directory. It`s perfect prepared for portable use already.
I used this JavaPortablizer and have now a folder JavaPortablizer on my portable device.
How can I use Phex now with Java?
Would be much appreciated if someone could provide some instructions (maybe for all java based programs).
Hi, ...
My "HelloWord" type, Java Portable batch file.
CrystalLiquid_JavaRunner.cmd
----------------------------
-->start /b \PortableApps\CommonFiles\Java\bin\javaw
-->-Djava.library.path=\PortableApps\CommonFiles\Java\lib
-->-jar cliquid2007.jar
Please note that = please concatenate the three lines, that begin with -->, it will be only one line, in your "CrystalLiquid_JavaRunner.cmd", file.
I hope it can help, ...
It work with my usb thumb drive, ...
Korgul, ...
Please delete my korgul, user account, ... (I not use it)
Even who doesn't have Java can install it trough this way. The installer downloads from net the Java installer, then installs it, then it copies the folders of the new installed Java for the new Portable Java folder (the CommonFiles\Java) and un-installs the installed Java, this only if it doesn't find any installed Java.
For being able to run Portable Java on Portable Firefox then this would ask if we want to tweak Portable Firefox (if found) to be able to run Portable Java. This way it wont break the license.
Many Unix/Linux apps install themselves like this. Downloading the (lets call it) "dependencies"; for example IEs4Linux work like this. This way, many installers can be made, that the average person can easily install, and without breaking a lot of licenses. (for example: portabilize... lets say Mono for installing a painting program that can't be portable because of the licensing of "dependencies" :D, I'm just kidding, I know this example it's not possible). What do you think?
(I need to post this in an individual thread)
____________________
The Blogger of Portimão now in English. And the Portuguese version can be found here.
Blue is everything.