Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

IntelliJ IDEA Keeps Eclipse Projects in Sync - Part II

DZone's Guide to

IntelliJ IDEA Keeps Eclipse Projects in Sync - Part II

· Java Zone ·
Free Resource

The CMS developers love. Open Source, API-first and Enterprise-grade. Try BloomReach CMS for free.

In the previous post we have discussed the basic integration between IntelliJ IDEA and Eclipse. What is most important, is the ability to keep the project structure synchronized between both IDEs.

Now, we have a project already imported. What shall we do to make libraries and dependencies available to the projects in IntelliJ IDEA and Eclipse? IntelliJ IDEA suggests a special setting that helps track changes in the project structure.

Open the Project Settings dialog (Ctrl+Alt+S-> 1) and click Modules:

[img_assist|nid=2139|title=|desc=|link=none|align=left|width=176|height=205]

 

 

 

 

 

 

 

In the Dependencies tab, make sure that the dependencies are stored in Eclipse format:

[img_assist|nid=2140|title=|desc=|link=none|align=left|width=347|height=75]

 

 

 

Now let’s see how it works. Add an archive to one of the modules in your IntelliJ IDEA project:

[img_assist|nid=2141|title=|desc=|link=none|align=left|width=585|height=258]

 

 

 

 

 

 

 

 

 

The new archive is properly added to the Eclipse .classpath file:

[img_assist|nid=2142|title=|desc=|link=none|align=left|width=502|height=163]

 

 

 

 

 

 

When you open the same project in Eclipse, you can explore its properties and find the newly added dependency in the right place:

[img_assist|nid=2143|title=|desc=|link=none|align=left|width=470|height=236]

 

 

 

 

 

 

 

 

The reverse action is also available: if a library is added in Eclipse, it becomes available in the synchronized IntelliJ IDEA project.

Enjoy!

BloomReach CMS: the API-first CMS of the future. Open-source & enterprise-grade. - As a Java developer, you will feel at home using Maven builds and your favorite IDE (e.g. Eclipse or IntelliJ) and continuous integration server (e.g. Jenkins). Manage your Java objects using Spring Framework, write your templates in JSP or Freemarker. Try for free.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}