作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我收到:
Exception in thread "main java.lang.NoClassDefFoundError: PageStore
Caused by: java.lang.ClassNotFoundException: PageStore
.
.
.
Could not find the main class: PageStore. Program will exit.
在 Windows 上运行我的 Java 程序时。
它在 linux 和 osx 上运行良好。
我从 .sh 或 .bat 文件运行它,其中包含:
javac -cp sesame.jar SimpleGraph.java PeerHandler.java ClientHandler.java Router.java PageStore.java
java -cp sesame.jar:slf4j-api-1.6.6.jar:slf4j-simple-1.6.6.jar:. PageStore
javac 命令工作正常并且可以在两个系统上编译。我在网上看到的所有其他解决方案都是将当前目录添加到我已经拥有的类路径中,并且没有提及在一个操作系统上工作而不是在另一个操作系统上工作。
最佳答案
Windows 上类路径的路径分隔符是分号,;
。
尝试:
java -cp sesame.jar;slf4j-api-1.6.6.jar;slf4j-simple-1.6.6.jar;. PageStore
关于java - "Could not find main class error"在 Windows 上,而不是在 Linux 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12590809/
我是一名优秀的程序员,十分优秀!