无法运行Java应用程序。主要没找到 [英] Cannot run Java application. Main not found
问题描述
我是java的新手,我需要运行一个我从网上下载的应用程序。有问题的应用程序是在这里找到的spinn3r客户端: http://code.google.com/p/spinn3r-client/downloads/detail?name=spinn3r-client-3.4.06.tar.gz
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
我解压缩了tar.gz并找到了一个.jar文件。然后我跑了:
I extracted the tar.gz and found a .jar file. I then ran:
java -jar applicationName.jar
我收到以下错误:
no main manifest attribute, in spinn3r-client-3.4.06.jar
如何解决此问题?
推荐答案
正如@Alderath所提到的,这主要是一个可以在自己的应用程序中使用的API。尽管如此,jar文件还包含测试客户端,您可以按如下方式启动:
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:
...
由于这不是可执行jar
文件,你需要通过必需的jar文件和显式包含 main
方法的类。
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.
这篇关于无法运行Java应用程序。主要没找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!