How to install a Java program (.jar)?

Being a new user, I understand that programs in openSUSE 11.1 should only be installed with Yast. But how then can I install a Java program (.jar) which I cannot find in a repository nor in or Webpin ? For example, I should like to install Arachnophilia.jar. (I have tried “java -jar Arachnophilia.jar” but it does not seem to install it.) Thanks.

From it’s home page:

**Run Arachnophilia **

  • Those who downloaded the Windows install program: * Click the program icon located at “Start … Programs … Arachnophilia … Arachnophilia” *
    This icon can be copied onto the desktop or anywhere else you want.
  • Those who downloaded the JAR file version: * Open a command console (Linux: shell console), move to the Arachnophilia program directory, type “java -jar Arachnophilia.jar” *

Is there any error message after executing

java -jar Arachnophilia.jar


You don’t install a .jar file, you simply run it within a java virtual machine as you stated

java -jar [file]

The problem may be that you don’t have a JVM installed.

Arachnophilia is a stand-alone Java program without an installer. So, this command should simply start it up. Does it? Which output can you see in the terminal?

Another case is a program like jEdit that has a Java-based installer that will install the program.

Not really. Yast provides a convenient interface for only installing programs packed into RPM packages. There are, however, other ways to install/use programs which Yast cannot handle, such as:
a) binary or Java-based installers (you simply run them in the terminal);
b) source-based installations (you have to compile them with make);
c) programs that require no install: just unpack them as necessary and copy to any place to which you have permissions (such as ~/bin/) and run.

Thank you, this is the answer! (Sorry if it was trivial.) After I installed Java (as described in the documentation) Arachnophilia did start with “java -jar Arachnophilia.jar”. I just understood the documentation as saying that I should install it with YAST.

A further beginner’s question: I now want to create an icon for that Java program on the desktop as well as in the main menu. What is the best way to do this?
PS. I found one way to do it: In the menu editor one can create a new entry including the command line ‘java -jar Arachnophilia.jar’ and the folder where the jar file is: ~/bin/. That icon one can then also drag onto the desktop. (One can also create an icon directly there, but it seems that one cannot drag it into the main menu.) This should be described in the KDE User Guide, but I did not find it.

Right click the menu to select the Menu Editor
Add an entry in the section you want, all you need is the command to launch it. You can also add an icon.