You are here

What about JAVA?

8 posts / 0 new
Last post
mostacholoco
Offline
Last seen: 10 years 8 months ago
Joined: 2007-05-04 10:12
What about JAVA?

Hello everyone Smile

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 Smile

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 7 years 5 months ago
Joined: 2006-11-18 10:26
I forgot where it's posted,

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!

wraithdu
Offline
Last seen: 10 years 9 months ago
Developer
Joined: 2007-06-27 20:22
I think you mean Klonk's

I think you mean Klonk's Portable Application Template, now at v2.1. It's in this forum.

Joble
Joble's picture
Offline
Last seen: 15 years 6 months ago
Joined: 2007-05-03 12:46
common

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

Java binaries go here or in X:\PortableApps\CommonFiles\Java for shared use.

To enable Java, copy the Java files from a local install, 
usually C:\Program Files\Java\jre1.5.0_11,
to this directory.  Copy the whole structure intact 
(so you'd have a lib and a bin directory in this
Java directory when complete.

Then, create a text file called javaportable.ini in the same directory as this readme.txt with the
following in it (altering for Java version):

[JavaPortable]
Vendor=Sun Microsystems Inc.
Version=1.5.0_11
URL=http://java.sun.com/

Have an Awesome Day!

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 7 years 5 months ago
Joined: 2006-11-18 10:26
Yeah, that was it. Having a

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!

jps
Offline
Last seen: 15 years 2 weeks ago
Joined: 2007-06-09 13:23
i might add a question here

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

korgul
Offline
Last seen: 15 years 2 months ago
Joined: 2006-01-25 22:08
Hi, ...My "HelloWord" java run, .cmd file.

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)

José Pedro Arvela
Offline
Last seen: 5 years 2 months ago
Joined: 2007-07-10 07:29
Idea for new Java Portabilizer

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

Log in or register to post comments