eclipse setup fails to run

msteiger

Active Member
Contributor
World
Architecture
Logistics
Hi,

I'm trying to setup Terasology (develop) for eclipse and ran into a few problems that might be worth mentioning (raise a github issue maybe?)

I read the Dev Setup Wiki, cloned the repo and created the eclipse project files using gradlew eclipse.

*) This also creates an ".project" file without content in the root folder which - for some reason - shadows the real project files.

*) The .gitignore files only ignores eclipse project files in the root folder. Adding the ** glob should fix that.

*) The actual projects "Core", "engine" and "PC" have cyclic dependencies. TerasologyTestingEnvironment references Terasology in "PC" (which it shouldn't, I guess)

*) Native libraries are not set. LWJGL bails out first. I added them all manually to "engine" and it seems to work.

*) Terasology crashes when I start a new game with a NPE in PlayerFactory.newInstance(PlayerFactory.java:80) - doorItem.getComponent(ItemComponent.class) returns null for some reason.

This is where I'm stuck now :-/

Note: It runs fine when I use gradle to run the game

Any idea? Should I create a github issue or even more than one?
Thanks
 

mkalb

Active Member
Contributor
Logistics
IntelliJ IDEA also shows a warning about "circular dependency between modules PC, engine".
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hiya msteiger - the Eclipse setup was more or less neglected during development of the new project structure, sorry about that :)

I was focused on getting it to run via command line and IntelliJ. I don't generally use Eclipse so it would take me some time to tweak the structure to work there. Any assistance and exact issues would be appreciated very much.

Would you be able to file issues in the Nanoware/Terasology issue tracker? I centralized all the restructure-type items over there due to the potential multi-project impact of testing / need to test against a separate line of Jenkins jobs.

The circular dependency is because the PC Facade depends (compile style) on the Engine, and the Engine depends (unit test style) on the PC Facade. This generally works (code gets compiled first then prepped for testing second) but may cause warnings like that. Probably a better way to do it somehow

That door error ... sounds odd. But then maybe it is just the first of many errors due to something missing from a classpath.
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
The engine doesn't really need to depend on the facade for testing. Whatever is being used from Terasology can be refactored out into engine.
 

msteiger

Active Member
Contributor
World
Architecture
Logistics
Thanks for your replies. I was able to fix some of the problems (see pull request on Nanoware/Terasology)

https://github.com/Nanoware/Terasology/pull/58

The remaining ones were converted into issues and can be found here:

https://github.com/Nanoware/Terasology/issues/54
https://github.com/Nanoware/Terasology/issues/56
https://github.com/Nanoware/Terasology/issues/57

I can now setup TS to run in eclipse, but it involves one or two not-so-elegant workarounds. I would therefore wait until these issues are resolved before updating the Wiki pages. It seems as if only very few TS devs are using eclipse..
 

mkalb

Active Member
Contributor
Logistics
I use Eclipse at work and I only use IntelliJ IDEA for Terasology/TerasologyLauncher. It is easier if all developers use the same IDE (gradle task, formatting, organize imports, ...).
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Much appreciated msteiger ! I commented on several of the issues and reviewed the PR :)

Yeah most use IntelliJ since we try to "officially support" that and it takes more effort to get them all working. I'd love to have the Eclipse setup good as well, but we really need an expert to maintain that setup - hint hint :D
 
Top