0

I am completely new to java and I need to just run an application I downloaded off the internet. The application in question is the "spinn3r" client found here: http://code.google.com/p/spinn3r-client/downloads/detail?name=spinn3r-client-3.4.06.tar.gz

I extracted the tar.gz and found a .jar file. I then ran:

java -jar applicationName.jar

I get the following error:

no main manifest attribute, in spinn3r-client-3.4.06.jar

How do I fix this?

Amitash
  • 1,029
  • 6
  • 16
  • 26
  • Do you want that whats inside that jar? If so, import that jar into eclipse, get the class files and then decompile them, to see what exactly that jar is doing... – Ars Mar 01 '13 at 11:27
  • Judging by a very quick look on the web page you linked, that doesn't seem like an executable. It is just a library with an API which you can use while developing your own java program. – Alderath Mar 01 '13 at 11:30

3 Answers3

1

As @Alderath mentioned, this is primarily an API which you can use in your own applications. Nevertheless, the jar file also contains a test client which you can launch as follows:

$ java -cp spinn3r-client-3.4.06.jar com.spinn3r.api.Main
Usage: com.spinn3r.api.Main [OPTION]

Required params:
...

Since this it is not an executable jar file, you need to pass the required jar files and the class which contains the main method explicitly.

Andreas Fester
  • 36,091
  • 7
  • 95
  • 123
0

For a JAR file to become executable, under META-INF/MANIFEST.MF, in your jar, you need to have this attribute:

Main-Class: youclassname.class
Pradeep Simha
  • 17,683
  • 18
  • 56
  • 107
-1

Collect all your .java files and .class files (and anything else you want to include) together in a single directory. Using a text editor, create a file (say, myManifest) containing the following lines:

      Manifest-Version: 1.0
      Main-Class: MyMainClass

where MyMainClass is the name of the class containing the main method you want to use.
From the command line, execute the command:

     jar cvfm myResult.jar myManifest *.java *.class

where myResult.jar is the jar file you are trying to create, myManifest is the file you created in step 2, and everything else is the files you want to include.
nick
  • 333
  • 1
  • 4
  • 15