Can't import the maven project in IntelliJ Idea 2016.1.1
Asked Answered
A

12

22

I am trying to import a project in IntelliJ Idea 2016.1.1 using: File->Project from existing sources->choose the required pom.xml

It comes to this dialog box, but nothing happens on clicking next button.

It comes to this dialog box, but nothing happens on clicking next button.

Abroach answered 7/4, 2016 at 10:15 Comment(7)
Are you sure the pom is valid?Ingeborgingelbert
Have you tried opening the pom.xml as a new project? I recall that IntelliJ will offer to create a project around it. If all else fails, maybe you could use the maven-idea-plugin to generate the project files.Nagaland
yea i tried all that and my pom is valid. because it worked fine after i restarted my system.Abroach
but i still would like to know what possible problem was there that it was not working before. Can anyone please helpAbroach
did you ever resolve this? I am having the same issueLunch
That time it got resolved after restarting my system. Haven't faced that after that. So, I am hoping it was some memory issue instead of maven or pom problem.Abroach
It happens on my mac too, although I'm using the newest intellijBarcellona
L
12

I had the same issue, but managed to solve it by updating my /etc/hosts file such that there is was only one entry for localhost

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
# 192.xxx.xxx.xxx localhost <-comment out this
255.255.255.255 broadcasthost
#::1             localhost <- comment out this
Lunch answered 7/6, 2016 at 8:50 Comment(5)
This fixed it for me too.Cauley
@Ben: How did you figure this out? This solution worked for me too. But how did you make the connection between the hosts file and IDEA not being able to parse a pom.xml?Irrefrangible
I'd like to know how can Ben know this can relate to this issue too. I had similar issue and this fix by fixing hosts file.Alamein
Hi @Irrefrangible This was a long time ago and unfortunately I have forgotten how I worked this one out.. I believe it was something to do with maven resolution failing with this configuration.Lunch
I finally found this solution also, and this is what fixed it for me. Took a lot of digging to find this solution, so to get more links to it out there, here's the comment thread on the jetbrains site that suggests this solution: youtrack.jetbrains.com/issue/IDEA-64132#comment=27-1411307Ocelot
S
10

In my case, this problem was solved by setting the JDK in IntelliJ IDEA settings. Like this:

Settings

Before selection correct JDK, I had the red text in this field.

Sagittarius answered 6/4, 2018 at 21:11 Comment(2)
It didn't work for me, however this screenshot has helped me to find the solution that worked for me: just above that line there is a line for setting the VM's max memory, which was the real cause of that issue on my laptop.Spikes
Worked for me! Thank youTwelfthtide
G
2

I have had similar issue on my spare computer, the problem appears when creating/importing Maven project. It seems for some reason it has lost the access to java SDK and it was not there, even thus I tried to re-importing it. I tried to select java SDK again with out luck. I ended up with following solution:

  1. Uninstalling IntelliJ (2016.2.4)
  2. Reinstalling Java JDK latest 1.8, restart the system
  3. Installing latest IntelliJ (2016.2.5)
  4. First time I started IntelliJ, and when creating first time new project, ensure selecting the correct SDK path (see image) enter image description here
  5. Now you should be able to (click on next) creating/importing new Maven project.

The other answers did not helped me much.

Geneva answered 4/11, 2016 at 14:55 Comment(2)
Just uninstalling and reinstalling IntelliJ fixed this issue for me.Yonyona
In my case the problem occured because I had just updated my java. Setting the correct (new) SDK path allowed me to then import my project.Hawn
T
2

I had the same issue just now,through the idea.log, I found the problem:

here

Caused by: com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java" (in directory "/Users/xxx/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/182.4129.33/IntelliJ IDEA.app/Contents/bin"): error=2, No such file or directory
    at 
com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:408)
    at com.intellij.execution.process.OSProcessHandler.startProcess(OSProcessHandler.java:51)
    at com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:44)
    at org.jetbrains.idea.maven.server.MavenServerManager$2.startProcess(MavenServerManager.java:367)
    at org.jetbrains.idea.maven.server.MavenServerManager$2.execute(MavenServerManager.java:358)
    at com.intellij.execution.rmi.RemoteProcessSupport.startProcess(RemoteProcessSupport.java:212)
    at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:139)
    ... 28 more

Look here

the jdk1.7.0_79.jdk have been removed,so it doesn't work...

Trunkfish answered 1/9, 2018 at 2:32 Comment(0)
S
1

I ran into this and at first it seemed due to the use of a tilde ~ in the file path of the root of the project. It also seemed to go "flaky" if you try to use a ~.

More investigation lead to: /home/user/.IdeaIC15/system/log (might be a bit different for other systems)

Do

tail -100f idea.log

in a terminal in that directory and see what you get when you click "next"

Mine was missing / corrupt java7 instance

All this is pertaining to Linux only.

Supplicant answered 2/9, 2016 at 18:40 Comment(0)
S
0

I had the same problem, turns out I had a lock on the directory. try renaming the folder to confirm this is not your issue. Once the lock is removed try importing the project.

Silent answered 28/1, 2017 at 15:0 Comment(0)
C
0

I know this is older issue, but today I also encountered this issue. In my case it was JDK unavailable (as my IntelliJ was pointing to external JDK which got updated and old path didn't exists). Nevertheless, the issue can be different for different people. The best way to tackle this problem is to check intelliJ logs, that will tell you exact issue it is facing and then proceed with its fix. I'm sure this will save your time and you will solve the issue very quickly.

How to locate idea.log file is here

P.S. May be when you read this post, the above link to locate idea.log file stale. So kindly get the updated link from IntelliJ jetbrains website (Look for idea.log file path)
OR follow the below steps:
1. Open intellij
2. Click on Help tab from menu-bar
3. Select Show log in Finder. Get the path to this path and do tail -f </path-to-file/idea.log>

enter image description here

Cayuse answered 2/1, 2018 at 11:39 Comment(0)
C
0

In my case to solve this problem I did a strace on Linux of the Intellij Java process that is called when you do a next (+ child processes) and discovered that it was related to the execution of the Maven embedded jar.

Execution of the Maven embedded jar (process 4940):

4940 execve("/home/rudy/Softwares/jdk1.8.0_111/bin/java", ["/home/rudy/Softwares/jdk1.8.0_11"..., "-Djava.awt.headless=true", "-Didea.version==2018.1.4", "-Xmx1024m", "-Didea.maven.embedder.version=3."...

Error returned by the process 4940:

4940 <... execve resumed> ) = -1 ENOENT (No such file or directory)

I had decided to move the jdk8 to a directory home/rudy/Softwares/jdks/jdk1.8.0_111 and it was previously in home/rudy/Softwares/jdk1.8.0_111.

It seems before to move JDKs used by Intellij to first reconfigure Intellij to use the new path and then use the import maven functionnality.

I did a mistake, it is true (moving the JDK) and Intellij has no way to know where the JDK was moved (unless scanning the all filesystem) but it should clearly display an error message and not get blocked on the 'next'.

Crookback answered 6/6, 2018 at 10:30 Comment(0)
L
0

I had this issue today and it took me 2 hours to identify and fix it. I tried to import the project from perforce workspace which had '/' in the workspace name (ABC/lighting_workspace).

When I created another perforce workspace without '/' in the name (lighting_workspace), I was able to import the existing project :)

Lure answered 2/8, 2018 at 3:7 Comment(0)
S
0

Had exactly the same issue, in my case it was a memory problem: the importer needed more memory than the one allowed by the VM's limit set by default after the installation of IntelliJ: I had 768 mb set by default and i moved them to 2048 mb.

You can set this under : Preferences |-> Build, Execution, Deployment |-> Build Tools |-> Maven |-> Importing |-> VM options for importer

VM options for Maven import in IntelliJ Idea

Spikes answered 16/8, 2018 at 10:45 Comment(0)
G
0
  1. Install latest version of Intellij Idea (leave everything by default) and Java JDK (called SDK in IDE).
  2. Create a new empty project.
  3. Press Ctrl+Alt+Shift+F to open Project Structure panel.
  4. Chose the SDK you downloaded, like : C:\Program Files\Java\jdk-10.0.2.
  5. Apply and File->Open your project
  6. Now it work ! (Also cleaned my host file)
Gooey answered 26/9, 2018 at 14:23 Comment(0)
S
0

In case the most voted solution doesn't work in your case, you can try my diagnose method for rare case problem:

In short, check ~/Library/Logs/JetBrains/IntelliJIdea2023.2/idea.log, and solve the warning and error in it, typically it is related to maven loading process.

I am working on IntelliJ IDEA 2023.2 (Ultimate Edition), in my case, the warning suggests that there are AI LLM plugin and kotlin plugin which blocks the maven loading process.

enter image description here

After I disable those plugins, the project import stuck problem just disappear.

Streamer answered 26/9, 2023 at 3:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.