Java:线程主java.lang.NoClassDefFoundError中的异常
我正在尝试让 Red5 Flash Media Server 在我的计算机上运行。我已经安装了它,但是当我运行服务器时,我收到此错误:-
Exception in thread "main" java.lang.NoClassDefFoundError: org/red5/server/Bootstrap
Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
Could not find the main class: org.red5.server.Bootstrap. Program will exit.
我遇到了这个链接,其中有人遇到了同样的问题: http://trac.red5.org/ticket/762
看起来他们运行了以下命令命令:
export CLASSPATH=3D$RED5_HOME/lib/slf4j-api-1.5.10.jar:$RED5_HOME/lib/logback- core-0.9.18.jar:$RED5_HOME/lib/logback-classic-0.9.18.jar
我在 /usr/share/red5 中安装了 red5,所以我运行了这个:
export CLASSPATH=3D$/usr/share/red5/lib/slf4j-api-1.5.10.jar:$/usr/share/red5/lib/logback-core-0.9.18.jar:$/usr/share/red5/lib/logback-classic-0.9.18.jar
然而尽管如此,我仍然看到相同的错误消息。
I am trying to get the Red5 Flash Media Server working on my computer. I have installed it, but when I run the server I get this error:-
Exception in thread "main" java.lang.NoClassDefFoundError: org/red5/server/Bootstrap
Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
Could not find the main class: org.red5.server.Bootstrap. Program will exit.
I came across this link where someone had the same issue:
http://trac.red5.org/ticket/762
It looks like they ran the following command:
export CLASSPATH=3D$RED5_HOME/lib/slf4j-api-1.5.10.jar:$RED5_HOME/lib/logback- core-0.9.18.jar:$RED5_HOME/lib/logback-classic-0.9.18.jar
I have red5 installed in /usr/share/red5, so I ran this:
export CLASSPATH=3D$/usr/share/red5/lib/slf4j-api-1.5.10.jar:$/usr/share/red5/lib/logback-core-0.9.18.jar:$/usr/share/red5/lib/logback-classic-0.9.18.jar
Yet despite all this I am still seeing the same error message.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在我从主干构建一个新的red5服务器到“dist”目录后,我曾经遇到过同样的问题,例如
“java.lang.ClassNotFoundException:org.red5.server.Bootstrap”
,只需指向RED5_HOME环境变量到那个
“dist”
位置。I used to have the same problem like
"java.lang.ClassNotFoundException: org.red5.server.Bootstrap"
after I builded a new red5 server from the trunk to 'dist' directoryjust point RED5_HOME environment variable to that
"dist"
location.正确的类路径是:
注意:
=
符号之后没有 3D/usr
之前任何地方都没有$
The correct class path is:
Notice:
=
sign$
before/usr
anywhere您需要确保您的 red5.sh 具有正确的权限:
java AccessController 失败,因此找不到该类。
You need to ensure your red5.sh has the correct permissions:
The java AccessController is failing, thus the class is not being found.
在 svn checkout 之后,您没有从源代码构建它。结帐后只需输入 ant :)。
You did not build it from source after svn checkout. Just type ant after checkout :).
这可能是不正确的:
我认为应该是:
如果这不起作用,那么服务器将忽略 CLASSPATH 环境变量。 Java EE 应用服务器不使用它。您使用哪种服务器软件作为监听器?
This might be incorrect:
I think it should be:
If that doesn't work, then the server is ignoring the CLASSPATH environment variable. Java EE app servers don't use it. Which server software are you using as the listener?
red5 引导类位于 boot.jar 中,这是启动 red5 时唯一需要位于类路径上的 jar。
The red5 bootstrap class is in the boot.jar and this is the only jar that needs to be on the classpath when starting red5.