1

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 :)

4

3 回答 3

2

解决方案是转到
Windows->preferences->java->compiler
编译器合规级别确保其 1.7,如果其 1.7 将其更改为较低的值并按确定,再次将其更改回 1.7 它应该可以工作。

于 2014-06-23T05:06:11.303 回答
0

如果问题仍然存在,请从此链接下载 liferay-sdk 并在 Eclipse 中更新 sdk。

我在这个页面中找到了 Lu Li 添加的。

于 2015-02-08T08:33:01.050 回答
0

我从来没有见过这个问题。您可能想检查 Eclipse 是否知道您正在使用的 JRE - 请注意,运行的 JRE Eclipse 与您用于项目的 JRE/JDK 之间存在差异。您将在首选项对话框中找到项目的 JRE(仅按 JRE 过滤)并检查您在此处引用的 JRE 是否确实存在。

当 Java 更新删除旧目录并将其自身安装到不同目录时,我看到了类似(但不相同)的令人费解的行为。当相关目录包含 JRE 的版本号/补丁级别时,这很容易发生。

于 2014-06-22T09:38:04.560 回答