首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Eclipse中运行时找不到类

在Eclipse中运行时找不到类
EN

Stack Overflow用户
提问于 2014-04-11 22:20:18
回答 2查看 2.3K关注 0票数 0

尝试在Eclipse中运行我的项目,但它创建了以下错误:

代码语言:javascript
复制
Apr 11, 2014 8:02:17 AM net.minecraft.launchwrapper.LogWrapper log
INFO: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
Apr 11, 2014 8:02:21 AM net.minecraft.launchwrapper.LogWrapper log
SEVERE: Unable to launch
java.lang.ClassNotFoundException: cpw.mods.fml.common.launcher.FMLTweaker
      at java.net.URLClassLoader$1.run(Unknown Source)
      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)
      at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:102)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at net.minecraft.launchwrapper.Launch.launch(Launch.java:94)
      at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

但是我的项目中包含了所有的文件。

这是一个与this非常相似的问题,但我尝试了刷新类路径的解决方案,但它不起作用。有什么建议吗?

在进阶时谢谢!

EN

回答 2

Stack Overflow用户

发布于 2014-04-11 22:32:54

如果您不确定是否导入了所有必需的包,请在引发此错误的类中按Ctrl + Shift +O,然后导入所有必需的包并重新编译代码。

票数 1
EN

Stack Overflow用户

发布于 2014-04-11 22:37:30

代码语言:javascript
复制
This problem clearly specifies it lacks class files.

Steps to narrow done this problem : 

First Approach
By clicking - Ctrl+Shift+T
Paste the package name cpw.mods.fml.common.launcher.FMLTweaker, you should be able to figure out, which jar/source file hold this.


Second Approach
Go to Build Path->Configure Build Path ->Order and Export-> Arrange the folders according to the sequence they have to be loaded. (Sometimes if A expects B but B is loaded after A, causes this issue)


Third Approach
Try to import the packages using Ctrl+Shift+o , which automatically gives the suggestions to select from . Pick the right one.

Fourth Approach,
This might be even happening because of the same name class conflicts.(Same Class Name used in multiples jars/source files) . Import the right package one from it.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23015231

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档