LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   jar files (https://www.linuxquestions.org/questions/slackware-14/jar-files-345608/)

Knowledgements 07-22-2005 01:17 AM

jar files
 
hello ,

how can i run jar files...

java -jar (command not found)...

Basel 07-22-2005 01:26 AM

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


Knowledgements 07-22-2005 01:33 AM

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

mrcheeks 07-22-2005 01:45 AM

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

AxeZ 07-22-2005 01:46 AM

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


/usr/lib/java/bin/java -jar <filename>

Basel 07-22-2005 01:46 AM

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??

Knowledgements 07-22-2005 02:46 AM

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 $*

Knowledgements 07-22-2005 03:10 AM

help me

uselpa 07-22-2005 03:14 AM

You cannot use the firefox plugin to run a Java program directly, you must use the java command.
Where is your java command located?

gbonvehi 07-22-2005 03:14 AM

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.

Knowledgements 07-22-2005 03:22 AM

i did that

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

says. ???

Knowledgements 07-22-2005 03:27 AM

ok. i've installed again and it worked.

very very thanks to gbonvehi

:)

uselpa 07-22-2005 03:36 AM

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.


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