我一直在试图运行从jar文件的工具软件,但它一直打印出来:Jar文件无法加载或找到主类
“无法找到或加载主类...”。
我试图解决这个问题,使用这个thread的信息,但似乎都是无用的。说实话,因为这是一个微不足道的问题,我越来越绝望。
不管怎么说,我所做的:
Main-Class: com.test.Test
我的清单属性:
jar cfm test.jar manifest.txt <full_path>/out/com/test/*.class
这是什么打包成jar文件(该文件的Test.class)
测试等级:
package com.test;
public class Test {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
你是如何试图调用它的? – KevinO
它看起来并没有正确打包你的jar(你不保留文件夹结构)。我想你想'jar cfm test.jar manifest.txt/out /' –
然后用'java -jar'或'java -cp'运行它吗? – fukanchik