问题描述
不是JAVA新手!
我不断收到Error: Could not find or load main class
,这在上周有效。我的命令行是
java -cp sample.jar com.sample.Myclass
sample.jar存在于当前文件夹中,Myclass.class具有public static void main(String[] args)
方法
我尝试过
java -cp C:\fullPath\sample.jar com.sample.Myclass
当我在上面的命令行中添加选项-verbose:class时,我看到jre \ lib中的所有jar,但没有sample.jar中的类
为什么Java会忽略我的-cp / -classpath参数?
JAR文件是从IntelliJ和Eclipse-> Export JAR中作为工件生成的
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)