Compatibility OpenJDk11 and Service BuildersCompatibility OpenJDk11 and Service Buildershttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1207751422024-03-28T13:23:31Z2024-03-28T13:23:31ZRE: RE: Compatibility OpenJDk11 and Service BuildersDaniel Ghttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1208089722021-05-25T08:51:37Z2021-05-25T08:51:37Z<p>Hi,</p>
<p> </p>
<p>Thanks for your answer, finally I compile every service with Java 8
to avoid this problems and others related to service builders</p>
<p> </p>
<p>Regards</p>Daniel G2021-05-25T08:51:37ZRE: Compatibility OpenJDk11 and Service BuildersOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1207752732021-05-07T09:24:02Z2021-05-07T09:24:02Z<p>Please check if <a
href="https://liferay.dev/en/b/moving-workspaces-to-jdk-11">David
covered any steps</a> that you are missing</p>Olaf Kock2021-05-07T09:24:02ZCompatibility OpenJDk11 and Service BuildersDaniel Ghttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1207751412021-05-07T07:31:59Z2021-05-07T07:31:59Z<p>Hi all,</p>
<p>I am facing issues with service builders in Liferay 7.3.</p>
<p>Every time I create a remote service builder, it fails due to
parameter errors. And when I try to migrate a service builder from
Liferay 7.1 to 7.3, I can compile and deploy but the service is not
registered and I can't use it.</p>
<p>The issue is due to jdk 11 compatibility. I've tried adding this:</p>
<pre><code class="language-java">tasks.withType(JavaCompile) {
// Generated classes using Jodd library are unable to be read when compiled against JDK 11
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}</code></pre>
<p>but after clean all and rebuild the service, when I try to compile I
got this error:</p>
<p> </p>
<pre><code class="language-html">Could not determine the dependencies of task ':modules:ServiceTest:ServiceTest-service:jar'.
> Could not resolve all task dependencies for configuration ':modules:ServiceTest:ServiceTest-service:compileClasspath'.
> Could not resolve project :modules:ServiceTest:ServiceTest-api.
Required by:
project :modules:ServiceTest:ServiceTest-service
> No matching variant of project :modules:ServiceTest:ServiceTest-api was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, and its dependencies declared externally but:
- Variant 'apiElements' capability Eulen_7_3_workspace.modules.ServiceTest:ServiceTest-api:1.0.0 declares an API of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
- Variant 'runtimeElements' capability Eulen_7_3_workspace.modules.ServiceTest:ServiceTest-api:1.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
</code></pre>
<p> </p>
<