我有一个奇怪的问题。当我尝试运行任何 .jar 文件时,收到错误消息:
---------------------------
Java Virtual Machine Launcher
---------------------------
Could not find the main class: C:\Program Files (x86)\DirBuster\DirBuster.jar. Program will exit.
---------------------------
OK
---------------------------
我尝试了多个 .jar 文件,但所有文件都会出现此错误。我尝试过重新安装JAVA,通过cmd运行程序,但问题仍然存在。 任何人都将不胜感激。
谢谢。
最佳答案
确保您有一个 main 方法(必须声明为 public static void) - 如果您的类中有多个 main 方法,请在 list 文件中声明入口点。
关于java - 无法执行.jar文件 "Could not find the main class",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10971308/