Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
I can't get my Liferay Portlet Project compiled, builted, etc.
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:
- In Eclipse, click on the "Window" menu and select "Preferences".
- In the left pane, expand the "Java" option and select "Installed JREs".
- Click the "Add" button to add a new JRE.
- In the "JRE Type" selection box, choose "Standard VM" and click "Next".
- 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).
- Select the newly added JDK and click the "OK" button.
- In the left pane, expand the "Java" option and select "Compiler".
- In the "Compiler Compliance" section, select the version of Java you want to use for your projects (for example, 1.8).
- 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.
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
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
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.
I have these settings:
you should not use jdk 17, you should use jdk 11 or jdk 8 base on your project requirement.
Powered by Liferay™