如何解决ClassNotFoundException? [英] How do I resolve ClassNotFoundException?
问题描述
我正在尝试运行Java应用程序,但收到此错误:
I am trying to run a Java application, but getting this error:
java.lang.ClassNotFoundException:
冒号到达后缺少的类的位置。但是,我知道该位置不存在,因为该类位于其他位置。如何更新该课程的路径?它是否与类路径有关?
After the colon comes the location of the class that is missing. However, I know that that location does not exist since the class is located elsewhere. How can I update the path of that class? Does it have something to do with the class path?
推荐答案
你的类路径坏了(这是非常 Java世界中的常见问题)。
Your classpath is broken (which is a very common problem in the Java world).
根据您启动应用程序的方式,您需要将参数修改为 -cp
,您的类路径在MANIFEST.MF或您的磁盘布局中输入。
Depending on how you start your application, you need to revise the argument to -cp
, your Class-Path entry in MANIFEST.MF or your disk layout.
这篇关于如何解决ClassNotFoundException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!