How can I have more than one project inside IntelliJ IDEA? - eclipse

I'm switching from Eclipse to IntelliJ IDEA.
In Eclipse I have many Java projects I can open and see the code I need. However, in IntelliJ IDEA I can see only one project at a time.
How can I have more than one project in the IDEA IDE?

This ...
In Eclipse I have many Java projects I can open and see the code I need
... refers to an Eclipse Workspace. There is no direct equivalent to Workspaces in IntelliJ.
IntelliJ provides a help topic titled Migrating From Eclipse to IntelliJ IDEA which maps Eclipse concepts to IntelliJ concepts. In particular, it has this to say about the absence of Workspaces from IntelliJ ...
The first thing you'll notice when launching IntelliJ IDEA is that it has no workspace concept. This means that you can work with only one project at a time. While in Eclipse you normally have a set of projects that may depend on each other, in IntelliJ IDEA you have a single project that consists of a set of modules.
If you have several unrelated projects, you can open them in separate windows.
If you still want to have several unrelated projects opened in one window, as a workaround you can configure them all in IntelliJ IDEA as modules.

You can open more than one project in the IDEA IDE.
In IntelliJ IDEA, you go to File -> New -> Module from Existing Source...
You can refer image to see:
After import your project. You will see result as image:

Related

eclipse: Managing projects

I have tried to find these out, but could not.
Can eclipse open all dependent projects? I have a maven project with dependencies. Can eclipse open dependent projects also? (or at least try to, as some of the dependencies are external and would have no sources/project)
As a workaround to the above possible limitation in eclipse, i have created working sets and added projects to them. But could not see an option to open all projects in a working set one one shot. Is there such an option?
(Using eclipse Kepler)
Selecting this option should do it for you.
mark all project, right click and select open project

Import multiple projects in IntelliJ IDEA

I have a number of projects in my Eclipse workspace, some of them plain ol' Java projects, some of them Java web applications, some of them Flash Builder Flex projects.
They all live in a directory hierarchy. How can I open all of them in IntelliJ IDEA to be able to migrate from Eclipse to IDEA? The projects reference each other.
You can create an IntellIJ IDEA Project from source using the Import Project in the main menu.
Select the eclipse .project file or .classpath then check Link created IntelliJ IDEA modules to Eclipse project files.
The official docs, here:
To import an existing Eclipse projects to IntelliJ IDEA:
Open the New
Project Wizard. Having selected the option Import project from
external model, click Next.
On the Import page of the New Project
Wizard, select Eclipse. Optionally, check the option Import into
current project. Click Next.
On the next page of the wizard, specify
the directory, that contains the desired Eclipse workspace. In the
section IntelliJ IDEA project and module file location, specify
whether you want to create IntelliJ IDEA module files in the same
directory where the Eclipse projects reside, or in a dedicated
directory of your choice.
Check the option Link created IntelliJ IDEA
modules to Eclipse project files to automatically synchronize the
Eclipse projects and IntelliJ IDEA modules.
Specify whether you want test sources to be imported.
Click Next. IntelliJ IDEA scans the specified workspace for projects.
On the next page of the wizard, select the Eclipse projects you want
to import. So doing, each Eclipse project is converted to a separate
IntelliJ IDEA module. Click Next. Specify the name for the new
IntelliJ IDEA project, and the location of the project files.
Select also the format in which the project will be stored. Click Finish.
If you select "Keep project and modules in" you could separate eclipse project and IntelliJ IDEA project files
I never did something like this, but after reading docs and playing a bit the options it should be the best way.

IntelliJ IDEA: Cannot import SBT project

I'm completely new to development using Play or IntelliJ for that matter. I've created a simple HelloWorld application using Activator, and this is an sbt project.
I've been trying to import this to IntelliJ and this is the screen I'm stuck at:
https://www.dropbox.com/s/we1a4a3184sojvb/Screenshot%202014-07-24%2016.57.11.png
In almost all tutorials I've been through online, I've seen people using an sbt option on the import screen. I've installed the SBT plugin as well, but that hasn't helped. I've restarted IntelliJ several times to no avail.
Where am I going wrong?
I'm running 13.1.4 with the SBT plugin installed.
I had this error when importing a new module from existing sources.
On the right-hand side of your IntelliJ window, you will see a list of vertical tabs, open the SBT tab.
Select the module that's causing trouble, right click on it, select "Detach external project"
Try to import the module again.
Move to /your-project-folder
Run ./activator
Type idea . It will generate IDEA project.
Open (not import) File->Open.. project in IDEA.
I had a similar problem which came from a different place than the other solutions here so adding it in case it occurs for others.
In my case the problem was caused by accidentally opening the IdeaProjects directory. When you do this, it creates the .Idea folder in that directory, and populates it as a project. This apparently also confuses the set import.
The solution is to remove the .Idea folder and open (not import) the directory again.
I encountered the same error when I was trying to import a new scala project A to an existing IntelliJ project B as a module. I solved the problem by following step below:
Go to your folder of project B. Open file .idea/sbt.xml.
Deleting the entry which includes the path of project A.
After a series of struggles, I must say something weird solved this problem – moving to IntelliJ IDEA Ultimate. That has built in Play application support and can run/debug/test the application out of the box, which is very handy.
All I can say after this experience was that JetBrains wants you to upgrade to Ultimate if you want things to work right out of the box.
I'm sure there are ways to get this working with CE also, but I wasn't successful with that.
Solved for
IntelliJ IDEA 2022.2.1 (Ultimate Edition)
scala plugin: 2022.2.12
sbt version: 1.7.1
doing these steps:
Unlink sbt Project(sbt toolbar), then link it again.
Delete modules (ctrl + alt + shift + s).
Remove .bsp/, and .idea/ config files.
Invalidate caches..(ctrl + f).
Restart IDEA.
The number of steps to make it work may vary.
Uninstall everything
Reinstall IntelliJ
Install the JetBrains official Scala plugin
Import the project
Make sure that the project has a build.sbt file in the right place, so that IntelliJ can find it as an SBT project.
This is about IntelliJ IDEA version 13.1.4.
This issue is solved in the latest updates of the SBT and Scala plugins.
Make sure that your java path is correct (IntelliJ can use other path than system defined)
Preferences -> Build, Execution, Deployment -> sbt -> JVM - choose a
correct JRE

maven integration in eclipse new project checked out but can't navigate

I am struggling with maven in Eclipse even though I have m2e.
I checked out a maven project from CVS and cannot navigate anywhere. If I try References > Project, I get a pop up saying:
"Problems opening an editor Reason: services does not exist".
services is the name of the main project, which has sub projects within it. It all builds successfully so I am not sure why Eclipse does not work.
I suspect something related to classpath but have no idea how to edit it since it is not available from the project's properties. I actually tried to manually create a .classpath file but it did not help.
I also converted the project to a maven project but that did not help either.
Any ideas? I am using Eclipse JUNO.
I figured out my issue. I had to check out the project from CVS. Then (that's the important part), perform a maven import of an existing project within eclipse. That created maven "ready" projects where I could use all of the IDE's functionality.
Yes, you're right. If you import directly from a repository, hovering, linking and opening declarations isn't gonna work. Your solution is right, although another one more direct is use the "File->New->Other->Maven->Checkout Maven Projects from SCM". If then, you have problems because you can't select any SCM type, check Checkout Maven project from SCM - no connectors. If with connectors installed you still have problems: http://forum.springsource.org/showthread.php?102665-SCM-types-not-available-in-Checkout-Maven-Projects-from-SCM.
If you have checked out project from svn, project checked out is not generally a eclipse project thats why general functionality of eclipse does not work for the same.
To achieve the same functionality of eclipse like eclipse reader and all other shortcuts,we have to convert the checked out project to eclipse project.
Steps to Convert checked out project to eclipse project:
Right Click on Checked-out Project.
Point to Configure.
Click on Convert to Maven Project.(if checked out project is maven project)
These steps will convert the project to Maven project.
All the eclipse functionality will work for the same.
In addition to ensuring that the projects are configured as Maven projects, you may also go to Project Properties (right-click on the project in Package explorer) > Project References, and add projects in the workspace that the selected project may have references to.
I had this problem, too.
It looks like after a search-in-workspace Eclipse opened a wrong file.
I pressed Strl+Shift+H (Open Type in Hierarchy), typed in the class name, and opened it. The file opened in a new tab, and everything was navigable again.
The difference in icons is:

Migrating From NetBeans to Eclipse

My company wants to migrate to Eclipse, I was wondering what options besides an Ant build are there to move our projects from Netbeans to Eclipse.
Tooooo ... oooo .... oooo late to answer but this works
http://www.coderanch.com/t/458555/vc/Export-Netbeans-Eclipse
i was looking for an answer my self and saw this question :)
Quoting:
Here is a little tutorial on "Importing projects from NetBeans to Eclipse".
Please try this:
PART I - NETBEANS
Open NebBeans.
Create a java project named "ToEclipse".
Build this project.
Then, NetBeans has created several folders. The important folders to us are (in my computer):
c:\User\Almir\NetBeans\ToEclipse\dist
c:\User\Almir\NetBeans\ToEclipse\src
PART II - ECLIPSE
Go to Eclipse.
Create a java project in Eclipse named "ToEclipse".
Then, Eclipse has created several folders. The important folders to us are (in my computer):
c:\Users\Almir\Eclipse\ToEclipse\bin
c:\Users\Almir\Eclipse\ToEclipse\src
PART III - WINDOWS EXPLORER
Go to Windows Explorer.
Copy the FILE "ToEclipse.jar" at c:\Users\Almir\Eclipse\ToEclipse\bin folder.
Past it in c:\Users\Almir\Eclipse\ToEclipse\bin
Copy the FOLDER "toeclipse" at c:\User\Almir\NetBeans\ToEclipse\src folder.
Past it in b) c:\Users\Almir\Eclipse\ToEclipse\src folder.
PART IV - ECLIPSE
Go to Eclipse.
Press F5 to refresh the view.
Verify that your project is there (under ToEclipse/src/toeclipse).
Say "Oh! Yes! It works!".
Run the project.
Return to 3) how many times you want!
I hope that helps you!
Kind regards,
Almir Campos
São Paulo, Brazil.
I found another easier way that worked for me at least since I had problems importing the Ant build script due to a missing javac.
Say you have your Netbeans project (src, build, dist etc) in D:/blah/
In Eclipse go to File->New->Java Project
Uncheck 'Use default location' and instead use the path where the Netbeans project is (D:/blah/) Eclipse should automatically populate everything else and link to the files as well.
I have recently 'migrated' from Netbeans to Eclipse and found it amazingly easy. The reason it was easy though is that all of our projects are IDE independent standard ant and ivy build scripts that most modern IDE's can understand. This way, we all get to use the IDE we like (yes - emacs and vi too) and their are no 'migration' issues.
The reason that I am pointing that out is that, if it is not already that way, I would recommend that you take that same path on your migration. Just create some standard ant (and ivy) build scripts. Eclipse knows how to slurp those in and there will be no future migration issues.
in MY PERSONAL experience, it was easy. I was migrating a java desktop app from netbeans to eclipse. Just copy my projects into the workspace, create the project in eclipse as a new java project and put the same name of the project in netbeans (use your workspace as location). It will recognize the project structure ( Eclipse Helios, Netbeans 6.8 )
Hope this helps. I don't know how hard it turns if you have another kind of project.
I just migrated a Netbeans 7.0 JSF web project to Eclipse. And it was easier than i would have imagined.
What i did was:
List item
Clean and build my JSF application in netbeans
Close netbeans and open Eclipse(i use galileo)
Create a new Dynamic Web Application.
Right click on the new web application in project explorer and go to import then to .WAR file
It then ask whether i want to import any of the jar files(libraries) as projects and i do not select any and just click finish.
Copied my netbeans src(source) folder /src/java/ to
the Eclipse src folder. e.g netbeansproject/medman/src/java/com to eclipseSpace/medman/src/
Next setup your server in Eclipse(i use tomcat 6.0).
And voila! it is done.
You can also check out this link. http://www.coderanch.com/t/458555/vc/Export-Netbeans-Eclipse
At my company people pretty much use either eclipse or Netbeans. I myself use both of them for various tasks. We write our own ant scripts to build and package our source so it does not matter what IDE a person uses. I would suggest that you create your own ant script to build your source, that way you won't have to depend on an IDE specific build script.