Search code examples
javaeclipseliferayliferay-6liferay-ide

Cannot create Liferay plugin project


I'm new to Liferay's universe, I'm trying to create a portlet but Eclipse throws this error :

Error Creating Liferay plugin project, please see eclipse error log for more details.

I checked the .log file :

!ENTRY com.liferay.ide.project.core 4 0 2014-06-21 23:56:42.463
!MESSAGE Error creating Liferay plugin project.
!STACK 1
org.eclipse.core.runtime.CoreException: One or more constraints have not been satisfied.
    at (......)
!MESSAGE One or more constraints have not been satisfied.
!STACK 1
org.eclipse.core.runtime.CoreException: One or more constraints have not been satisfied.
at (......)
Contains: Liferay Portlet 6.0 requires Java 1.5 or newer.
Contains: Dynamic Web Module 3.0 requires Java 1.6 or newer.
!SUBENTRY 2 org.eclipse.wst.common.project.facet.core 4 0 2014-06-21 23:56:42.465
!MESSAGE One or more constraints have not been satisfied.
!SUBENTRY 3 org.eclipse.wst.common.project.facet.core 4 0 2014-06-21 23:56:42.465
!MESSAGE Liferay Portlet 6.0 requires Java 1.5 or newer.
!SUBENTRY 3 org.eclipse.wst.common.project.facet.core 4 0 2014-06-21 23:56:42.465
!MESSAGE Dynamic Web Module 3.0 requires Java 1.6 or newer.

I'm using Java 1.7 (tried also with 1.8), so I don't understand from where this error might come from. here is my configuration :

-Eclipse Kepler -Tomcat 7 (Liferay 6.2 CE) -java 1.7 / 1.8

thanks for your help guys :)


Solution

  • I haven't seen this problem ever. You might want to check if Eclipse knows the JRE you're working with - note that there's a difference between the JRE Eclipse runs on vs. the JRE/JDK that you're using for projects. You'll find the project's JRE in the preferences dialog (just filter by JRE) and check if the JRE that you're referencing there does indeed exist.

    I have seen similar (but not the same) puzzling behaviour when a Java update removed an old directory and installed itself into a different directory. This happens easily when the directory in question contains version numbers/patch levels for your JRE.