LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   running .jar files (https://www.linuxquestions.org/questions/linux-general-1/running-jar-files-475261/)

computerages 08-18-2006 09:00 PM

running .jar files
 
hi, i've download jave-based installer fro jedit from its website... but now the problem is ".jar" file opens up in Archive Manager program when I click on it...instead of running the auto-installer...

tangle 08-18-2006 09:04 PM

I think java -jar <filename> will work.

computerages 08-18-2006 09:08 PM

Quote:

Originally Posted by tangle
I think java -jar <filename> will work.

hi, thx for the super quick response..

that's what i get:
Code:

[root@localhost ~]# java -jar jedit42install.jar
Failed to load Main-Class manifest attribute from jedit42install.jar
[root@localhost ~]#


timothyb89 08-19-2006 12:44 AM

Update JRE...?

Matir 08-19-2006 01:30 AM

That looks like it's not a valid JAR file to me. You could unzip it and run the class files directly, perhaps.

jlliagre 08-19-2006 02:29 AM

I would think of a broken/uncompatible jdk/jre.

What reports: "java -version" ?

robbbert 08-19-2006 02:47 PM

Quote:

Failed to load Main-Class manifest attribute from jedit42install.jar
Open the file with some archive manager. Check if a file /META-INF/MANIFEST.MF exists within that. Check whether this file contains the line "Main-Class: folder1.folder2.file". "folder1.folder2.file", of course, is just a placeholder of mine. Check whether the file /folder1/folder2/file exists in the archive.

If you've did that, and just nodded, "OK, exists", jedit42install.jar should be valid (which is likely). In this case, we'ld need to find out more about your Java version (as jlliagre suggested).

computerages 08-19-2006 03:45 PM

thx every1 for the replies

java -version:
Code:

[zixan@localhost ~]$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.1 20060525 (Red Hat 4.1.1-1)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[zixan@localhost ~]$

I think there's a problem whith the gnu java installed on my system, as the file exists suggested by robbbert. I also installed java by sun (jre) using this tutorial but I think my system is not configuring it as the default java plugin..

jlliagre 08-19-2006 04:09 PM

Use the full path to where you have installed Sun's JRE, eg.
Code:

/opt/jre1.5.0_07/bin/java -jar jedit42install.jar
By the way, this is unrelated to the browser java plugin.

computerages 08-19-2006 05:51 PM

Quote:

Originally Posted by jlliagre
Use the full path to where you have installed Sun's JRE, eg.
Code:

/opt/jre1.5.0_07/bin/java -jar jedit42install.jar
By the way, this is unrelated to the browser java plugin.

thanks jlliagre, finally got it running... :)

tangle 08-19-2006 06:01 PM

You could link /opt/jre1.5.0_07/bin/java to /usr/bin then you wouldn't have to type the full path. Or just include the /opt/jre1.5.0_07/bin/ in your profile path.

computerages 08-19-2006 07:31 PM

tangle, do you know how can I link through the terminal, as I don't have root access in GUI? Or, is there a way to have root access with normal login in GUI?

debiant 08-19-2006 07:53 PM

Quote:

Originally Posted by computerages
tangle, do you know how can I link through the terminal, as I don't have root access in GUI? Or, is there a way to have root access with normal login in GUI?

su
ln -sv

tangle 08-19-2006 07:59 PM

ln -s <file your want to link> <file you want to link to>

ln -s /opt/jre1.5.0_07/bin/java /usr/bin/java


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