Skip to content
Advertisement

java.lang.ClassNotFoundException when trying to load derived class

I have two different Modules: MultiRealm and SurvivalRealm. MultiRealm provides an abstract class (LoadedRealm) which the class SurvivalRealm (in the Module SurvivalRealm) extends. Now, MultiRealm tries to load the SurvivalRealm class from the jar. But when trying to load, i get the Following error: java.lang.NoClassDefFoundError: net/lightbluefoxlabs/dev/multirealm/core/multirealmcore/Realms/LoadedRealm where net/lightbluefoxlabs/dev/multirealm/core/multirealmcore/Realms/LoadedRealm is the correct location of the LoadedRealm class. Here is the Stacktrace:

JavaScript

Here is the SurvivalRealm class:

JavaScript

… and this static function in LoadedRealm tries to import this class:

JavaScript

Here is a picture of the Structure: enter image description here

The MultiRealm Module does not import/”Know about” (excuse my terminology) the SurvivalRealm module, only the other way around.

Am I just trying to achieve something impossible? If you need the .iml file, just ask. Any help would be really apreciated, I have been trying to fix this issue for basically the whole day now. Thanks for reading through this beginner issue.

Advertisement

Answer

You should try using your pom files from maven for achieve your goal. A multi-module project is defined by a parent POM referencing one or more submodules.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement