how can I execute a .jar file in linux

J

JTL.zheng

I am using Red hat linux
and had install the JRE (use command: ./jre-1_5_0-linux-i586-rpm.bin
and it has done)

but when I click a xxx.jar file,it can't be executed
(this file can be executed in windows)

how can i do to execute a .jar file in linux?

thank you very much in advance
 
?

=?ISO-8859-1?Q?Thomas_G=F6tzinger?=

In order to run a jar-file under windows you have to run the command
java -jar {jarname} and the "system classpath" have to contain the java.exe.

Perhaps (I'm not a linux prof.) you have to add the path of the java jre
to the classpath of linux as well.
 
M

Manish Pandit

Are you double clicking it in gnome file explorer? If yes, then you
need to establish file associations. Personally, I prefer to associate
..jar files with something like winzip or gzip as not all jars are
executable. You can use java -jar <jar file name> to execute the jar
files, which do have an executable main class (like argouml).

-cheers,
Manish
 
S

Simon Brooke

I am using Red hat linux
and had install the JRE (use command: ./jre-1_5_0-linux-i586-rpm.bin
and it has done)

but when I click a xxx.jar file,it can't be executed
(this file can be executed in windows)

how can i do to execute a .jar file in linux?

java -jar [relative pathname of jar file]

To make clicking on jar files cause them to run in KDE, right click on one,
choose 'Open with...', choose 'Other', enter 'java -jar ', and
tick 'Remember application association for this type of file'. Sorted.

--
(e-mail address removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/
"The result is a language that... not even its mother could
love. Like the camel, Common Lisp is a horse designed by
committee. Camels do have their uses."
;; Scott Fahlman, 7 March 1995
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top