Executing Java App from script/Link to application

Discussions Regarding Software

Moderator: Moderators

Executing Java App from script/Link to application

Postby serenicom » Sat Sep 29, 2007 9:47

I am attempting to run a java application from a menu item or desktop link. The app runs if I use:
exec java -jar /home/username/jbidwatcher/JBidWatcher-1.0.2.jar
or
java -jar /home/username/jbidwatcher/JBidWatcher-1.0.2.jar.
in a terminal session. I tried putting this into a script:

#!/bin/bash
exec java -jar /home/username/jbidwatcher/JBidWatcher-1.0.2.jar

But running it just opens the script file in an editor. I have set it as an executable, same result. I am new to Sabayon, and a bit lost, help would be appreciated.

Phil S.
serenicom
Baby Hen
 
Posts: 6
Joined: Fri Aug 17, 2007 12:35

Re: Executing Java App from script/Link to application

Postby dave_p_b » Fri Oct 12, 2007 8:15

Hi

Did you get this working?
I just downloaded JBidwatcher 1.0.2 from here to my desktop.

I opened up a konsole and just typed:
cd Desktop
java -jar JBidWatcher-1.0.2.jar

and it just worked.

There is a couple of things to check:
1) The file that you download is a 32-bit binary file so you need to make sure that you are running it with a 32-bit version of java.
2) Check that you have got the latest version of java 1.6u3 by opening up a konsole and typing:
su (Enter root password)
emerge emul-linux-x86-java
This will update to the latest 32-bit version of java.
3) Open up a normal konsole and type java-config -L. For Example, mine says the following:
dave@sabayonx86-64 ~ $ java-config -L
The following VMs are available for generation-2:
1) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2]
*) Sun 32bit JRE 1.6.0.03 [emul-linux-x86-java-1.6]
3) Sun JDK 1.6.0.03 [sun-jdk-1.6]
dave@sabayonx86-64 ~ $

The * indicates the current default java in use. If the * isn't besides Sun 32bit JRE 1.6.0.03 [emul-linux-x86-java-1.6] like it is on mine then you just need to enter java-config -s 2 (where the number 2 indicates which line you want to choose, from the previous output.)

4) After you've done this the you should be able to open up a konsole and type cd to the directory that you downloaded JBidWatcher-1.0.2.jar to and then type java -jar JBidWatcher-1.0.2.jar
With mine i didn't even need to change the JBidWatcher-1.0.2.jar file to an executable for it to run.

Hope this helps

All the best

Dave
User avatar
dave_p_b
Old Dear Hen
 
Posts: 607
Joined: Fri Dec 15, 2006 1:39
Location: Exeter, UK


Return to Software in General

Who is online

Users browsing this forum: No registered users and 0 guests