0

Trying to run my project in Eclipse, but it creates the following error:

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)

But I have all of the files included in my project.

This is a very similar issue to this, but I tried the solution of refreshing the classpath and it didn't work.

Any suggestions?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
  • 1
    If you're not sure that all the required packages are imported, hit Ctrl + Shift + O inside the class that raises this error, and import all the required packages and the compile the code again. – Mohsen Kamrani Apr 11 '14 at 14:23
  • what are you exactly trying to do? The question lacks information. You get ClassNotFoundException in a lot of cases. You already had a running code in eclipse and suddenyl you got this error or you imported a project and then you couldn't run it. what kind of project is it? – Sambhav Sharma Apr 11 '14 at 14:24
  • Actually you could also look into markers and look for java errors if you have any.. or maybe build path errors. – Sambhav Sharma Apr 11 '14 at 14:25
  • Wow @mok I can't believe I did not know that shortcut :P Thanks for sharing – Gladhus Apr 11 '14 at 14:31
  • @aileron565> So I posted it as an answer. – Mohsen Kamrani Apr 11 '14 at 14:33

2 Answers2

1

If you're not sure that all the required packages are imported, hit Ctrl + Shift + O inside the class that raises this error, and import all the required packages and the compile the code again.

Mohsen Kamrani
  • 7,177
  • 5
  • 42
  • 66
0

This problem clearly specifies it lacks class files.

Steps to narrow done this problem :

  1. 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.

  1. 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)

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

  3. 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.

Elikill58
  • 4,050
  • 24
  • 23
  • 45
Sireesh Yarlagadda
  • 12,978
  • 3
  • 74
  • 76