Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij - Add project dependency like in Eclipse

I'm switching to Intellij and trying to do the same thing as in Eclipse. In Eclipse, you can add a project as a dependency in another project (project properties -> "Java Build Path" -> "Projects" -> Click on my library project).

The current situation is that I'm developing a library and I can test the features in another project without building the jar file every time I add new stuff to the library.

I'm trying to achieve this with Intellij but without success (the projects are both imported in Intellij).

How can I do that?

like image 582
user2336315 Avatar asked Mar 04 '15 21:03

user2336315


People also ask

How do I add a project as a dependency of another project in Eclipse?

Instead open the project properties of the second project and select "Java Build Path". On the right side on the "Projects" tab you can add your first project as "required project on the build path". The class files of project 1 are now added to the class path of project 2.

How do I act like an Eclipse in IntelliJ?

If you go to File -> Settings -> Keymap you can choose Eclipse from the dropdown list.

Can I Import IntelliJ project to Eclipse?

From the main menu, select File | Export | Project to Eclipse…. The Export to Eclipse dialog displays the list of modules that have not been converted and switched to use the Eclipse format yet (the modules that have the IntelliJ IDEA module format . iml). Select the modules you want to export.

How to add a project as a dependency in IntelliJ?

1 I'm switching to Intellij and trying to do the same thing as in Eclipse. In Eclipse, you can add a project as a dependency in another project (project properties -> "Java Build Path" -> "Projects" -> Click on my library project).

How to migrate from Eclipse to IntelliJ IDEA?

In this case, your Eclipse project will be migrated to IntelliJ IDEA. Launch IntelliJ IDEA. If the Welcome screen opens, press Ctrl+Shift+A, type project from existing sources, and click the Import project from existing sources action in the popup.

How do I convert an Eclipse project to a dependency file?

The Project tool window displays the newly created Eclipse files. From the main menu, select File | Project Structure Ctrl+Alt+Shift+S or click on the toolbar. Select the module you want to convert and switch to the Dependencies tab. From the Dependencies storage format list, select Eclipse (.classpath).

How do I add a module as a dependency in Eclipse?

Click a project and from the right hand side select Dependencies tab. This will show you projects that are not imported in red coloured text. HTH Add the module you want to add as dependency. Add your module dependency in your project. If you use Maven you'll see the following message: Module 'your-module' is imported from Maven.


2 Answers

File > Project Structure. Then choose your module, and add any dependency, either Jar, Library or Module:

IntelliJ Screenshot

Larger image here: http://i.imgur.com/rjdxJHx.png

like image 180
acanby Avatar answered Sep 22 '22 16:09

acanby


From File -> project structure, select Modules. You will be presented with all the added projects. Click a project and from the right hand side select Dependencies tab. This will show you projects that are not imported in red coloured text. HTH

like image 43
Thirumalai Chellam Balagopalan Avatar answered Sep 24 '22 16:09

Thirumalai Chellam Balagopalan