You are here

Portable JRE & Batch files

15 posts / 0 new
Last post
RossGoodman
Offline
Last seen: 3 years 5 months ago
Joined: 2005-12-19 12:51
Portable JRE & Batch files

Hi

I have followed the advice of others and have placed a JRE on my USB, just in time as my current desktop only has 1.3 !

For most of my apps (datastudio & freemind) I simply create a batch file which hard codes the relative path to the java.exe and this works a treat.

Two questions:

1)
When I do this I end up with 1 dos window and 1 app window, is there any way I can get the dos window to "go away" leaving my application running. On *nix I would simply tell it to run in the background.

2)
The batch file approach does not seem to work with RSSOwl, I get "Exception in thread "main" java.lang.NoClassDefFoundError: java"
Any ideas ?

Ross

Deuce
Offline
Last seen: 14 years 2 months ago
Developer
Joined: 2005-12-24 16:32
As for question one....

As for question one, CMDOW is a tool that can be used to hide the command window. Check it out here:
CMDOW Homepage

As for question 2, I unfortunatley can't answer that.

Deuce
"Portable Software: Just the beginning..."

Deuce
Portable Software: Just the beginning.

jimjams
Offline
Last seen: 17 years 10 months ago
Joined: 2005-12-12 04:56
I use the following batch

I use the following batch with RSSOWL
z: is my data disk (an encrypted disco from the usb key
t: is my USB key

hoping this can be of some help

copy "z:\dati\tool\rssowl\.rssowl\*.*" "%USERPROFILE%\.rssowl\"
copy "z:\dati\tool\rssowl\.rssowl\archive\*.*" "%USERPROFILE%\.rssowl\archive\"
"t:\tool\JRE\bin\javaw" -Xmx256m -jar "t:\tool\rssowl\rssowl.jar"
copy "%USERPROFILE%\.rssowl\*.*" "z:\dati\tool\rssowl\.rssowl\"
copy "%USERPROFILE%\.rssowl\archive\*.*" "z:\dati\tool\rssowl\.rssowl\archive\"
del "%USERPROFILE%\.rssowl" /S /Q
pause

RossGoodman
Offline
Last seen: 3 years 5 months ago
Joined: 2005-12-19 12:51
At the moment I am using the

At the moment I am using the .exe version and I pass it the following parameter

-profile .

This tells it to store the config in the same dir as the RSSOwl directory so I don't have to do all the copying.

This is the equivalent command for the java version:
..\jre1.5.0_06\bin\java -jar -Duser.home=. -Djava.library.path=. .\rssowl.jar

jimjams
Offline
Last seen: 17 years 10 months ago
Joined: 2005-12-12 04:56
Good advice, I still use the

Good advice, I still use the .bat but now use the -Duser.home
Not using the exe version because it doesn't work if you haven't a java JRE installed on the host pc...

RossGoodman
Offline
Last seen: 3 years 5 months ago
Joined: 2005-12-19 12:51
Hmmm, I have downloaded

Hmmm, I have downloaded cmdow and mave managed to type the commands required.
However the subsequent commands are not run until after rssowl, or specifically java terminates.

So my question really is how do I get a program to run "in the background" in the same was that "runme &" would do in unix?

Thanks

Torpedro
Offline
Last seen: 11 years 2 months ago
Joined: 2006-02-05 14:52
run in background

Hi!
To run a program in background you can use:
start "title of Window" "Letter:\My Path\Exefile" parameters
or when you don't have spaces in your path it's even simpler:
start Letter:\MyPath\Exefile parameters

The "title of Window"-stuff is only needed when Exefile is "Exefile", because the start command ALWAYS uses the first string in "" as the window title.

Is this what you meant?
Torpedro

RossGoodman
Offline
Last seen: 3 years 5 months ago
Joined: 2005-12-19 12:51
OK, I tried this, it could

OK, I tried this, it could be because I am running Java, it seems to be opening the Java in a cmd window and then the programs GUI is being displayed. Java does not "finish" until I close the application.
I think I am going to have to live with two windows open for all of my Java based apps.

allquixotic
Offline
Last seen: 18 years 2 weeks ago
Joined: 2006-02-27 09:29
IBM

IBM has recently released their free Eclipse DeveloperWorks bundle, which is basically Eclipse 3.1 with the IBM Java 1.5.0 implementation. Obviously this JRE is useless if you insist on using the internal Sun-specific APIs in your applications, but it is compliant with the Java SE 1.5 spec. I found that its performance is slightly less, but it didn't crash on me or anything. Plus, the Eclipse that comes with it appears to be quite portable. Smile

Since this JRE doesn't actually install (it's just a .zip that you extract), it seems pretty portable already. Sun's JRE is silly and insists on relying on the registry and other stuff.

jimjams
Offline
Last seen: 17 years 10 months ago
Joined: 2005-12-12 04:56
Link pls

Link pls

Ryushi
Offline
Last seen: 16 years 3 months ago
Joined: 2005-12-09 09:30
Links

Hi jimjams,

I think it is this:
http://www-128.ibm.com/developerworks/java/jdk/eclipse/

Cya Ryushi

cmmehl
Offline
Last seen: 13 years 9 months ago
Joined: 2006-01-27 09:55
Couldn't find any jre on the

Couldn't find any jre on the eclipse site. On the contrary, it says that java is required to run the app ...

Chris

Always on the move - love all portable apps!

allquixotic
Offline
Last seen: 18 years 2 weeks ago
Joined: 2006-02-27 09:29
Chris, Eclipse was

Chris,

Eclipse was originally a closed-source program developed by IBM. Later, they released the source code to the Eclipse Foundation, who now maintains it as an open-source app. However, IBM continues work on Eclipse in an open source format, and for some unconscionable reason, they have been producing "DeveloperKits" -- basically, the latest version of Eclipse from www.eclipse.org + the IBM Java 1.5 runtime. Do a search on IBM DeveloperWorks and follow through the site. Create an IBM account and download it.

agel
Offline
Last seen: 12 years 1 month ago
Joined: 2006-08-17 12:38
concerning portablEclipse...

... take a look at this post!

Deuce
Offline
Last seen: 14 years 2 months ago
Developer
Joined: 2005-12-24 16:32
You might want to...

take a glance at the NSIS Code that this developer created a JAVA launcher. I looks into 4 different places for the javaw.exe file. Which according to him uses no command window. You can look at it on the NSIS page at:

http://nsis.sourceforge.net/A_slightly_better_Java_Launcher

Hope it works for you.

***********************************
Deuce   {The Core}
"Portable Software: Just the beginning..."

Deuce
Portable Software: Just the beginning.

Topic locked