NoClassDefFoundError when referencing from Android Project to standard Java project

I am currently working on an android application that needs to use some generic classes that are also used on some servers. Therefore, on the one hand, I have this standard java project inside eclipse where I have POJOs, infercas and so on. And on the other hand, I have an Android application project with an activity that needs to use these POJOs.

My first attempt at getting an android project to know that the java project is just adding it as a "required project" in the path building properties inside eclipse. This resulted in:

java.lang.NoClassDefFoundError: my.package.Pojo

      

I searched for it and tried a lot, but still the question is:

How do I set things up correctly so that my ADT v21.1 android project still knows my java project even at runtime?

Some things I've already tried that didn't seem to change anything:

  • after adding the "required project" I also set the export dependency in the eclipse order and export dialog

  • I tried to create java project as jar file and add it as jar dependency to android project

  • I created android library project as "glue": I added java project as library project dependency and library project as "android dependencies" to android project

  • I have verified that all projects where inside the filesystem are in the same parent folder (read that the main ant task may have some problems otherwise)

  • I googled for a loooong time

It would be nice if someone could help. Maybe I just missed a little tiny mind?

Bluddy

+3


source to share


1 answer


The problem is I am creating a java project using Java 7, which does not seem to be supported by android. The Fix pointed this out in a very helpful post (he also said it himself): fooobar.com/questions/1999802 / ...



(Bloddimarry's answer, I just posted it here to help it shut it down)

+4


source







All Articles