LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-22-2005, 01:17 AM   #1
Knowledgements
Member
 
Registered: Jul 2005
Posts: 56

Rep: Reputation: 15
jar files


hello ,

how can i run jar files...

java -jar (command not found)...
 
Old 07-22-2005, 01:26 AM   #2
Basel
Member
 
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319

Rep: Reputation: 30
Re: jar files

Quote:
Originally posted by Knowledgements
hello ,

how can i run jar files...

java -jar (command not found)...
Code:
java -jar jarfile
is the correct syntax. However, it seems that you don't have java in your PATH.
try the following:
Code:
which java
echo $PATH
 
Old 07-22-2005, 01:33 AM   #3
Knowledgements
Member
 
Registered: Jul 2005
Posts: 56

Original Poster
Rep: Reputation: 15
which java =

which: no java in (/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin)

but java is working ... in firefox
 
Old 07-22-2005, 01:45 AM   #4
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 50
Edit your /home/username/.bash_profile and add the path to java in it

exemple :

JAVA_HOME=/opt/jdk1.5
export JAVA_HOME

PATH=$JAVA_HOME/bin:/usr/bin:/blablbablabla
export PATH
 
Old 07-22-2005, 01:46 AM   #5
AxeZ
Member
 
Registered: Sep 2002
Location: Novi Sad, Vojvodina
Distribution: Slackware, FreeBSD
Posts: 386

Rep: Reputation: 32
It is because firefox has plugin linked directly into plugins directory.
You should give full pathname then.


/usr/lib/java/bin/java -jar <filename>
 
Old 07-22-2005, 01:46 AM   #6
Basel
Member
 
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319

Rep: Reputation: 30
Quote:
Originally posted by Knowledgements
which java =

which: no java in (/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin)

but java is working ... in firefox
Refer to your post to get the answer:
Firefox plugin = Java Runtime environment??
 
Old 07-22-2005, 02:46 AM   #7
Knowledgements
Member
 
Registered: Jul 2005
Posts: 56

Original Poster
Rep: Reputation: 15
it says that

/usr/bin/cgoban: line 25: 3388 Segmentation fault /home/mesut/firefox/firefox-installer/plugins/libjavaplugin_oji.so -jar $CGOBAN_DIR/cgoban.jar $*
 
Old 07-22-2005, 03:10 AM   #8
Knowledgements
Member
 
Registered: Jul 2005
Posts: 56

Original Poster
Rep: Reputation: 15
help me
 
Old 07-22-2005, 03:14 AM   #9
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
You cannot use the firefox plugin to run a Java program directly, you must use the java command.
Where is your java command located?
 
Old 07-22-2005, 03:14 AM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
It should be: /usr/java/jre1.5.0_02/bin/java -jar $CGOBAN_DIR/cgoban.jar $*

The jre1.5.0_02 directory may vary depending on the version of Java you've installed.
 
Old 07-22-2005, 03:22 AM   #11
Knowledgements
Member
 
Registered: Jul 2005
Posts: 56

Original Poster
Rep: Reputation: 15
i did that

Failed to load Main-Class manifest attribute from
/usr/local/cgoban/cgoban.jar

says. ???
 
Old 07-22-2005, 03:27 AM   #12
Knowledgements
Member
 
Registered: Jul 2005
Posts: 56

Original Poster
Rep: Reputation: 15
ok. i've installed again and it worked.

very very thanks to gbonvehi

 
Old 07-22-2005, 03:36 AM   #13
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
man java says:

-jar Executes a program encapsulated in a JAR archive. The first
argument is the name of a JAR file instead of a startup class
name. In order for this option to work, the manifest of the JAR
file must contain a line of the form Main-Class:classname.
Here, classname identifies the class having the public static
void main(String[] args) method that serves as your applica-
tion's starting point. See the Jar tool reference page and the
Jar trail of the Java Tutorial for information about working
with Jar files and Jar-file manifests. When you use this
option, the JAR file is the source of all user classes, and
other user class path settings are ignored.

Get in contact with the developer and ask him how to run this, or to fix it if it's broken.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jar files problem rainbowarrior Suse/Novell 1 11-03-2005 05:22 AM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 05:26 AM
Jar files krazibon3 Linux - Newbie 3 08-05-2004 09:42 PM
What do i do with .jar files joeman3429 Fedora 11 07-26-2004 11:00 AM
jar files mlynch147 Programming 2 10-24-2001 07:11 AM


All times are GMT -5. The time now is 07:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration