脚本错误:线程“main”中出现异常java.lang.NoClassDefFoundError: org/codehaus/classwor lds/Launcher
我在 Windows XP 中运行 OpenStreetMap 的 Osmosis,以从较大的数据集中剪切数据的子集。在各种情况下,程序要么挂起,要么给出以下错误:
C:\Documents and Settings\mmorisy\tools>osmosis.bat --read-xml enableDateParsing
=no file="us_zipcodes.osm" --log-progress interval="10" --bounding-box top=43.22
868195 left=-73.5981635 bottom=41.2283584 right=-69.814204 --write-xml file="mas
s_zipcodes.osm"
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classwor
lds/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.codehaus.classworlds.Launcher. Program will
exit.
我感觉 Java 没有正确安装或配置,但我已经从 Oracle 网站安装了最新的 SDK,并且不知道我还可以在哪里安装尽管可能有六种变化,但还是会出错。
I'm running OpenStreetMap's Osmosis in Windows XP to cut a subset of data from a larger set. In various incarnations, the program either hangs or gives me the following error:
C:\Documents and Settings\mmorisy\tools>osmosis.bat --read-xml enableDateParsing
=no file="us_zipcodes.osm" --log-progress interval="10" --bounding-box top=43.22
868195 left=-73.5981635 bottom=41.2283584 right=-69.814204 --write-xml file="mas
s_zipcodes.osm"
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classwor
lds/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.codehaus.classworlds.Launcher. Program will
exit.
I get the feeling that Java isn't properly installed or configured, but I have installed the most revent SDK from Oracle's website and can't figure out where else I might be going wrong, despite maybe half dozen variations.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您收到的错误意味着 Java 本身已正确安装,但它找不到它尝试运行的 .class 文件。
据猜测,osmosis.bat 中的 classworlds.jar 文件有一个不正确的 -jar 或 -cp(或 -classpath)参数。
The error you're getting implies that Java itself is installed correctly, but it can't find the .class file it's trying to run.
At a guess, osmosis.bat has an incorrect -jar or -cp (or -classpath) argument to the classworlds.jar file in it.