powered by Jive Software

Large Number of Eclipse Errors after SVN import

Hi all,

Followed the steps here for compiling on Eclipse 3.3: http://www.igniterealtime.org/community/docs/DOC-1020

Trunk checked out fine, but the project is throwing about 1,000 errors mainly in the package declarations, stuff like:

package org.jivesoftware.openfire does not match expected package java.org.jivesoftware.openfire

Attached a screenshot… note the bugs in the bottom Perspective.

I’m using 1.6 debug compatibility… tried 1.5, doesn’t change much

Any ideas where I’m going wrong? The project does build but it’s annoying having 1,000 errors, makes it tricky to debug.

Looking at the source tree it seems like the classes are being imported as java.org.jivesoftware.* but the package declarations omit the java. portion.

Oh and I am using latest Eclipse (3.5 RC2) on OS X 1.5 with jdk1.6

Any help is appreciated, thanks everyone,

Duncan

Update: I was able to eliminate the package declaration errors by setting /src/java as my source path under Project…Properties…Java Build Path (it had been using /src/ as the default, which was what messed up the packages by trying to prepend that “java” package before each declaration.

However it appears the project is missing components, as many import statements are failing, for example org.xmpp is not in the source tree, nor is org.dom4j, org.slf4j, etc. Couldn’t find any .jars in the SVN trunk either. Guess I’ll go around and find these packages and import them manually. Fun stuff.

Anyone else having similar difficulties with an Eclipse build? Can’t imagine I’m the only one…

Update 2: I managed to find the missing Jars, they were in build/libs and although I had imported that dir, it was not picking up most of the JARs for some odd reason. So to do this you need to do is go into your Build Path and look at Libraries… Add External Jars. Then add all jars in /build/libs and all of it’s subdirectories. (screenshot attached)

This will clear up 99% of the errors but depending on your compiler settings you may be left with a few Access Restriction errors on certain classes. Those don’t really matter to the build, there more just warnings (to my knowledge), so we can resolve those by going into the Java Compiler settings and dropping those cases to Warnings rather than Errors. (screenshot attached)

But wait! There’s more! Assuming you followed the steps outlined here to build the project from Ant and set your Run Configuration: http://www.igniterealtime.org/community/docs/DOC-1020 , you actually still need to make one more change and then you can run the server:

The step that reads: “Enter -DopenfireHome="$/target/openfire" in the VM arguments box.” is evil and wrong (at least on Mac OS X / BSD). You do not need the $/ in the beginning, so the line should read -DopenfireHome=“target/openfire”

After that when you run you will get the lovely message:

Openfire 3.6.4 [Jun 16, 2010 1:24:32 PM]

Admin console listening at http://127.0.0.1:9090

Hopefully this will help anyone having compile issues on Eclipse. For me this was not obvious and not covered in the walkthroughs provided.

Happy coding,

Duncan


READ THE ENTIRE ABOVE THREAD IF YOU ARE GETTING HUNDREDS OF ERRORS TRYING TO BUILD OPENFIRE SOURCE IN ECLIPSE

Hi,

I did change the Openfire home in the document to -DopenfireHome="${workspace_loc:openfire}/target/openfire which should also be fine, also for MacOS. It seems that {…} was removed by SBS, maybe during a migration.

LG