No JDK specified error message for maven project.



I've just imported a new maven project but can't run any of the goals.

I get a Run Error dialog that says "Error running jboss-seam-booking-parent [test]: No JDK specified".

I'm not sure what this error message means as I have a valid JDK configured for the project. Is there somewhere else that I need to specifiy a JDK for?

Thanks in advance.


Comment actions Permalink

I hope you've managed to figure it out by now. If not, try setting the environment variable JDK_HOME and JAVA_HOME to the directory where your JDK is installed. I use Ubuntu 8.04 with bash as my shell so mine is set to (in my $HOME/.profile):

export JDK_HOME=/usr/lib/jvm/java-6-sun

After you do this, make sure that you are able to view these environment variables from an xterm or a DOS window (if you're using MS-Win) and then restart IntelliJ.

Also, inside IntelliJ, you should set your JDK if these settings don't get picked up by IntelliJ. Use ctrl-alt-shift-S and then select JDKs in the left panel. In the right panel, configure it accordingly (select the directory where the JDK is installed on your box). I'm attaching a screenshot to give you some perspective. Hopefully it's useful. All the best.

Screenshot-Project Structure.png
Comment actions Permalink

Hi Viraf,

Thanks for your reply.

Unfortunately, your suggestions have not worked.

I am running on Mac OS X. My maven project works fine from bash, but not in idea.

I had the JAVA_HOME environment variable set already but not JDK_HOME.  I set JDK_HOME to point to my jdk installation but this made no difference.

In Idea, I have my project JDK set to my jdk 1.6 installation and all my modules inherit this setting.

I really can't think why this isn't working and can't figure out why Idea gives "No JDK specified" when there definitely is a JDK specified for the project.

Any other suggestions/help would be much appreciated.



Comment actions Permalink


Can you please post a sample project (zip file which includes Maven POM) with just one class so I can try to reproduce this problem. Unfortunately I don't have access to Windows or Mac. Both my machines at home (desktop and laptop) are powered by Ubuntu Linux.

Comment actions Permalink

Ensure that your maven plugin for IntelliJ is configured correctly:

Navigate to File > Settings
Select Maven under the Project Settings section of the tree menu
Select Runner from the Maven subgroup
Select the appropriate JRE or environment variable pointing to one

Comment actions Permalink

Navigate to File -> Project Structure

Select the appropriate value under "Project SDK"


Please sign in to leave a comment.