Page 1 of 1

How do I run a .jar file?

Posted: Fri 30 Dec 2005, 18:16
by Lobster
As I understand it .jar is a java file and I have sun java installed so eh . . .
:oops: how do I run it? (just clicking would be nice . . .)

Thanks in advance for any help

Posted: Fri 30 Dec 2005, 18:21
by MU
You must add a small shellscript.

Code: Select all

#!/bin/sh

### ensure, we are in the correct folder

mypath=`echo $0|sed 's/[^/]*$//'|sed 's/\/$//'`
if [ "$mypath" = "." ]; then
  mypath=`pwd`
fi
cd $mypath

java -Xmx256m -jar $mypath/ArtOfIllusion.jar
-Xmx256m reserves 256 MB for the Program, not everyone needs this option, but some do.
If the way to determine the correct folder does not work (maybe ROX 2.3), you need an absolute path:

Code: Select all

#!/bin/sh
mypath=/usr/local/ArtOfIllusion
cd $mypath
java -Xmx256m -jar $mypath/ArtOfIllusion.jar
Save it as "run-AOI" for example, make it executable (chmod 755 run-AOI or via rightclick), then you can click on it or drag it to the Desktop.

Mark

Posted: Fri 30 Dec 2005, 18:25
by Guest
java -jar blahblah.jar

Posted: Fri 30 Dec 2005, 20:35
by Lobster
Anonymous wrote:java -jar blahblah.jar
thanks guys

yep that worked - got this going . . .
http://drawswf.sourceforge.net/

8)

addition

Posted: Fri 30 Dec 2005, 21:40
by klhrevolutionist
Correct java -jar blah.jar

Also, if you rename the blah.jar to blah.zip you can open up this file and take a look inside for goodies. Mostly pics, fonts etc..

FYI

Re: How do I run a .jar file?

Posted: Fri 30 Dec 2005, 22:43
by 1ColdBeer
Hi,
Lobster wrote: how do I run it? (just clicking would be nice . . .)
In rox right click blahblah.jar > set run action > Enter shell command > java -jar "$1"

That should make jar files clickable. (I bet you knew that)

Dave

Posted: Fri 30 Dec 2005, 22:49
by BarryK
Lobster, are you using John Murga's Java PupGet package?

Posted: Fri 30 Dec 2005, 23:55
by Lobster
BarryK wrote:Lobster, are you using John Murga's Java PupGet package?
No I am using G2's Sun full version . . .

Be interesting to get a list of jar or java files in general that run with John Murgas tiny java

Posted: Sat 31 Dec 2005, 02:21
by GuestToo
my Java installer downloads and installs Java 1.5.0_4 ... the latest version is Java 1.5.0_6 i think

it's easy to install Java anyway, you just download and run the installer from
http://www.java.com/en/download/manual.jsp

then you have to symlink from the Java plugin to the Mozilla/Firefox plugins folder, and setup PATH and JAVA_HOME

my installer should setup PATH and JAVA_HOME in /etc/profile.local, but it sets it up in /etc/profile, so upgrading Puppy can disable running java from the command line (java -jar blah.jar)

it's another item in my todo list ...