I can't get my Liferay Portlet Project compiled, builted, etc.

Jamie Sammons, modified 2 Years ago. New Member Posts: 7 Join Date: 4/4/23 Recent Posts

Hi,

I can't get my Liferay Portlet Project compiled, builted, etc.with my Eclise IDE, Liferay IDE plugin for Eclipse IDE, and Gredly 8.0.2. Installed Java is Adoptium OpenJDK 11.

I tried to ask sollutions for this from ChatGPT Open AI but it can't help me and looping same answers again and again. Then I asked this from ChaGPT:

I think now my Eclipse IDE for J2EE Developers installation is broken somehow and that’s why I can’t compile, build, install J2EE dependencies for it with Liferay IDE and Gredly.

Phase 1:

I installed Eclipse IDE when Java 8 SE was installed. In this phase Gredly installed J2EE dependencies.

Phase 2:

I installed Oracle OpenJDK 12 and still I was not apple to build, compile, etc with Gredly.

Phase 3:

I installed Eclipse Adoptium OpenJDK 11 and deleted J2EE dependencies.

Anyway, what to do now?

And here is ChatGPT AI answer:

"If you have installed a JDK in your system and added it to the system's PATH environment variable, you can configure Eclipse to use it as the default JDK for your projects. Here are the steps to do that:

  1. In Eclipse, click on the "Window" menu and select "Preferences".
  2. In the left pane, expand the "Java" option and select "Installed JREs".
  3. Click the "Add" button to add a new JRE.
  4. In the "JRE Type" selection box, choose "Standard VM" and click "Next".
  5. In the "JRE Definition" screen, click the "Directory" button and browse to the directory where your JDK is installed (for example, C:\Program Files\Java\jdk-17.0.1).
  6. Select the newly added JDK and click the "OK" button.
  7. In the left pane, expand the "Java" option and select "Compiler".
  8. In the "Compiler Compliance" section, select the version of Java you want to use for your projects (for example, 1.8).
  9. Click the "Apply and Close" button to save the changes.

After these steps, Eclipse should be using the specified JDK for your projects. You may need to refresh your project and rebuild it to see the changes take effect."

And etiher this answer did not help.

​​​​​​​What I shoud to do now? My project is just a HelloWorld Liferay Spring MVC Portlet Project.

thumbnail
Adrian Häussler, modified 2 Years ago. New Member Posts: 18 Join Date: 8/3/22 Recent Posts

Hi,

you should provide more details about the error, do you have an error message, what happens if you try to build..?
Also, some more details about your project might be helpful, what kind of portlet are you building?
What is Gredly? Do you mean Gradle?
 
Without knowing the error details its hard to help, it could be anything

Jamie Sammons, modified 2 Years ago. New Member Posts: 7 Join Date: 4/4/23 Recent Posts

Here is error message:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'HelloWorld'.
> Dependencies can not be declared against the `compileClasspath` configuration.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.0.2/userguide/command_line_interface.html#sec:command_line_warnings

CONFIGURE FAILED in 6s

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'HelloWorld'.
> Dependencies can not be declared against the `compileClasspath` configuration.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.0.2/userguide/command_line_interface.html#sec:command_line_warnings

CONFIGURE FAILED in 1s


​​​​​​​

thumbnail
Jiang Simon, modified 2 Years ago. New Member Posts: 8 Join Date: 10/16/13 Recent Posts

If you use Eclispe Jee + install update site, you can try to manually set the java home path for gradle, you can find gradle settings in  Eclipse, click on the "Window" menu and select "Preferences", then you can find gradle java home in this setting page like below.


 

Jamie Sammons, modified 2 Years ago. New Member Posts: 7 Join Date: 4/4/23 Recent Posts

I have these settings:


​​​​​​​

thumbnail
Jiang Simon, modified 2 Years ago. New Member Posts: 8 Join Date: 10/16/13 Recent Posts

you should not use jdk 17, you should use jdk 11 or jdk 8 base on your project requirement.