From 418e5309e0234c02700cb826d176a926e3ab041d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Delhom=C3=A9nie?= Date: Tue, 2 Sep 2025 09:57:24 +0200 Subject: [PATCH 1/2] Add troubleshooting on usage of JRE --- SDK6UserGuide/install.rst | 26 +++++++++++++++++--------- SDK6UserGuide/troubleshooting.rst | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/SDK6UserGuide/install.rst b/SDK6UserGuide/install.rst index c17f0c2a7..5215a6ac4 100644 --- a/SDK6UserGuide/install.rst +++ b/SDK6UserGuide/install.rst @@ -31,26 +31,34 @@ System Requirements Check your JDK version ---------------------- -The SDK requires a JDK 11 or a higher LTS version to be installed and: +The SDK requires a JDK (not a JRE) 11 or a higher LTS version to be installed and: - The ``JAVA_HOME`` environment variable set to the path of a JDK. OR -- The ``java`` executable of a JDK available in the ``PATH``. +- The ``java`` and ``javac`` executables of a JDK available in the ``PATH``. If the ``JAVA_HOME`` is set to a JDK, make sure that it is a JDK 11 or a higher LTS version. -If the ``JAVA_HOME`` is not set, make sure a JDK executable is available in the ``PATH`` environment variable. -To check, run ``java -version`` in a terminal:: +If the ``JAVA_HOME`` is not set, make sure a JDK executables are available in the ``PATH`` environment variable. +To check, execute ``java -version`` in a terminal:: $ java -version - openjdk version "11.0.15" 2022-04-19 - OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10) - OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode) + openjdk 11.0.19 2023-04-18 + OpenJDK Runtime Environment Temurin-11.0.19+7 (build 11.0.19+7) + OpenJDK 64-Bit Server VM Temurin-11.0.19+7 (build 11.0.19+7, mixed mode) -If you don't have a JDK installed, -you can download and install one from `Adoptium `__. +Then execute ``javac --version``:: + + $ javac --version + javac 11.0.19 + +If the ``java`` program is not found, it means there is no JDK installed or it is not available in the ``PATH`` or ``JAVA_HOME`` environment variables. +If it is not installed, you can download and install one from `Adoptium `__. + +If the ``java`` program is found but not the ``javac`` program, it means a JRE is installed and used, not a JDK. +In this case, install a JDK. You can download and install one from `Adoptium `__. .. _sdk_6_configure_repositories: diff --git a/SDK6UserGuide/troubleshooting.rst b/SDK6UserGuide/troubleshooting.rst index 2582b13e9..666b26489 100644 --- a/SDK6UserGuide/troubleshooting.rst +++ b/SDK6UserGuide/troubleshooting.rst @@ -438,6 +438,23 @@ If the ``prod`` version is deployed in another repository declared after the Mic To fix this, declare the repository containing the ``prod`` version before the one containing the ``eval`` version. Refer to :ref:`sdk_6_howto_gradle_add_repository` for more details on how to declare module repositories. +.. _sdk_6_missing_compilation_capability: + +Missing Compilation Capability +------------------------------ + +During the build of a project (precisely the Java compilation phase), the error following may be raised:: + + * What went wrong: + Execution failed for task ':compileJava'. + > Error while evaluating property 'javaCompiler' of task ':compileJava'. + > Failed to calculate the value of task ':compileJava' property 'javaCompiler'. + > Toolchain installation 'C:\Program Files (x86)\Eclipse Adoptium\jre-11.0.28.6-hotspot' does not provide the required capabilities: [JAVA_COMPILER] + +This means that the JDK used by Gradle is not a JDK but a JRE, whereas Gradle and the SDK require a JDK. +Therefore, the solution is to install and configure a JDK. +Refer to :ref:`sdk_6_check_jdk` for more information. + .. | Copyright 2008-2025, MicroEJ Corp. Content in this space is free for read and redistribute. Except if otherwise stated, modification From 68ed90f1b1bf769f6f1a83e45067d08e6b0a6f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Delhom=C3=A9nie?= Date: Tue, 2 Sep 2025 10:08:52 +0200 Subject: [PATCH 2/2] Replace by to prevent confusions --- SDK6UserGuide/appendix/javaLambdas.rst | 2 +- SDK6UserGuide/howtos/disableIvyDescriptorPublication.rst | 2 +- SDK6UserGuide/howtos/gradleJavaHome.rst | 4 ++-- SDK6UserGuide/howtos/gradleMultiRepositories.rst | 6 +++--- SDK6UserGuide/install.rst | 2 +- SDK6UserGuide/licenses.rst | 4 ++-- SDK6UserGuide/troubleshooting.rst | 6 +++--- SDKUserGuide/mmm.rst | 2 +- SDKUserGuide/mmmRepository.rst | 2 +- VEEWearUserGuide/android/installation.rst | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/SDK6UserGuide/appendix/javaLambdas.rst b/SDK6UserGuide/appendix/javaLambdas.rst index 21cf08157..b2ed15342 100644 --- a/SDK6UserGuide/appendix/javaLambdas.rst +++ b/SDK6UserGuide/appendix/javaLambdas.rst @@ -15,7 +15,7 @@ By default Gradle will use the Java toolchain available locally, but it can be c } This settings plugin downloads the first Java toolchain matching the specified requirements that it finds among the -`JVM Vendors `__ recognized by Gradle and unzips it in the ``$USER_HOME/.gradle/.jdks`` folder, +`JVM Vendors `__ recognized by Gradle and unzips it in the ``/.gradle/.jdks`` folder, so you do not have to install one manually. .. note:: diff --git a/SDK6UserGuide/howtos/disableIvyDescriptorPublication.rst b/SDK6UserGuide/howtos/disableIvyDescriptorPublication.rst index 8f44cff24..155b3755c 100644 --- a/SDK6UserGuide/howtos/disableIvyDescriptorPublication.rst +++ b/SDK6UserGuide/howtos/disableIvyDescriptorPublication.rst @@ -12,7 +12,7 @@ Disable Ivy Descriptor Publication by Default If you don't need SDK 5 backward compatibility, you can disable Ivy descriptor publication by setting the Gradle property ``enable.ivy.descriptor.default=false``. -This property can be set in a ``gradle.properties`` file in ``$USER_HOME/.gradle/`` to apply it globally, or at the root of the Gradle project to +This property can be set in a ``gradle.properties`` file in ``/.gradle/`` to apply it globally, or at the root of the Gradle project to apply it at project level. It can also be passed to command line with ``-Penable.ivy.descriptor.default=false`` option. diff --git a/SDK6UserGuide/howtos/gradleJavaHome.rst b/SDK6UserGuide/howtos/gradleJavaHome.rst index 09c54b4a1..4a8a3c540 100644 --- a/SDK6UserGuide/howtos/gradleJavaHome.rst +++ b/SDK6UserGuide/howtos/gradleJavaHome.rst @@ -9,13 +9,13 @@ you can define the property ``org.gradle.java.home`` in the `Gradle Properties < Gradle Properties can be defined in the following locations, sorted by the highest priority: - command line, as set using ``-D``. -- ``gradle.properties`` in the ``GRADLE_USER_HOME`` directory (defaults to ``$USER_HOME/.gradle``). +- ``gradle.properties`` in the ``GRADLE_USER_HOME`` directory (defaults to ``/.gradle``). - ``gradle.properties`` in the project directory, then its parent project directory up to the build root directory. - ``gradle.properties`` in the Gradle installation directory. If an option is configured in multiple locations, the first one found in any of these locations wins. Therefore, if you want all your Gradle project to use a different JDK than the system default JDK, -you can add the following property in the file ``$USER_HOME/.gradle/gradle.properties``:: +you can add the following property in the file ``/.gradle/gradle.properties``:: org.gradle.java.home="C:\\path\\to\\the\\jdk" diff --git a/SDK6UserGuide/howtos/gradleMultiRepositories.rst b/SDK6UserGuide/howtos/gradleMultiRepositories.rst index 1bccc0a1d..993f6662a 100644 --- a/SDK6UserGuide/howtos/gradleMultiRepositories.rst +++ b/SDK6UserGuide/howtos/gradleMultiRepositories.rst @@ -5,9 +5,9 @@ How To Configure Multiple Gradle Repositories If you want to make MicroEJ repositories available only to some projects, here is an example of configuration: -- Create a folder ``repositories`` in ``$USER_HOME/.gradle/init.d``. +- Create a folder ``repositories`` in ``/.gradle/init.d``. - Move ``microej.init.gradle.kts`` to the ``repositories`` folder. -- Create a new ``repositories.init.gradle.kts`` file in ``$USER_HOME/.gradle/init.d`` with the following content:: +- Create a new ``repositories.init.gradle.kts`` file in ``/.gradle/init.d`` with the following content:: val defaultRepository = "myOtherRepo" // can be set to null val selectedRepository = System.getProperty("gradle.repository") ?: defaultRepository @@ -37,7 +37,7 @@ activate these repositories by default, you can edit the ``defaultRepository`` i .. warning:: - If you put a repository configuration file that ends with ``.gradle.kts`` at the root of ``$USER_HOME/.gradle/init.d``, + If you put a repository configuration file that ends with ``.gradle.kts`` at the root of ``/.gradle/init.d``, it will be automatically loaded. Contrary to what the official Gradle documentation says, the files does not need to end with ``.init.gradle.kts``. That is the reason why we recommend to put the files in a folder. These files also need to end with ``.gradle.kts``. diff --git a/SDK6UserGuide/install.rst b/SDK6UserGuide/install.rst index 5215a6ac4..4c1008234 100644 --- a/SDK6UserGuide/install.rst +++ b/SDK6UserGuide/install.rst @@ -41,7 +41,7 @@ OR If the ``JAVA_HOME`` is set to a JDK, make sure that it is a JDK 11 or a higher LTS version. -If the ``JAVA_HOME`` is not set, make sure a JDK executables are available in the ``PATH`` environment variable. +If the ``JAVA_HOME`` is not set, make sure the JDK executables are available in the ``PATH`` environment variable. To check, execute ``java -version`` in a terminal:: $ java -version diff --git a/SDK6UserGuide/licenses.rst b/SDK6UserGuide/licenses.rst index 441fe1b5c..185035c31 100644 --- a/SDK6UserGuide/licenses.rst +++ b/SDK6UserGuide/licenses.rst @@ -75,7 +75,7 @@ If the SDK EULA is not accepted, the following message is displayed when executi The license terms for this product can be downloaded from https://repository.microej.com/licenses/sdk/LAW-0011-LCS-MicroEJ_SDK-EULA-v3.1C.txt You can accept the EULA by setting the system property systemProp.accept-microej-sdk-eula-v3-1c=YES in a gradle.properties file - - in your Gradle User Home folder ($USER_HOME/.gradle/), + - in your Gradle User Home folder (/.gradle/), - or in the root folder of your project, or specifying the -Daccept-microej-sdk-eula-v3-1c=YES command line option, or setting the ACCEPT_MICROEJ_SDK_EULA_V3_1C=YES environment variable. @@ -88,7 +88,7 @@ As mentioned in the message, there are several ways to accept the SDK EULA: systemProp.accept-microej-sdk-eula-v3-1c=YES - This can be in the ``gradle.properties`` of your Gradle User Home folder (located by default at ``$USER_HOME/.gradle/gradle.properties``), + This can be in the ``gradle.properties`` of your Gradle User Home folder (located by default at ``/.gradle/gradle.properties``), or in the ``gradle.properties`` file at the root of your project for example. - define the ``accept-microej-sdk-eula-v3-1c`` system property in the command line: diff --git a/SDK6UserGuide/troubleshooting.rst b/SDK6UserGuide/troubleshooting.rst index 666b26489..b1892623a 100644 --- a/SDK6UserGuide/troubleshooting.rst +++ b/SDK6UserGuide/troubleshooting.rst @@ -297,7 +297,7 @@ This feature can be disabled for a build by passing the ``--no-watch-fs`` option ./gradlew build --no-watch-fs -or for all builds by setting the following property in the ``$USER_HOME/.gradle/gradle.properties`` file:: +or for all builds by setting the following property in the ``/.gradle/gradle.properties`` file:: org.gradle.vfs.watch=false @@ -443,7 +443,7 @@ Refer to :ref:`sdk_6_howto_gradle_add_repository` for more details on how to dec Missing Compilation Capability ------------------------------ -During the build of a project (precisely the Java compilation phase), the error following may be raised:: +During the build of a project (precisely the Java compilation phase), the following error may be raised:: * What went wrong: Execution failed for task ':compileJava'. @@ -451,7 +451,7 @@ During the build of a project (precisely the Java compilation phase), the error > Failed to calculate the value of task ':compileJava' property 'javaCompiler'. > Toolchain installation 'C:\Program Files (x86)\Eclipse Adoptium\jre-11.0.28.6-hotspot' does not provide the required capabilities: [JAVA_COMPILER] -This means that the JDK used by Gradle is not a JDK but a JRE, whereas Gradle and the SDK require a JDK. +This means that the Java installation used by Gradle is not a JDK but a JRE, whereas Gradle and the SDK require a JDK. Therefore, the solution is to install and configure a JDK. Refer to :ref:`sdk_6_check_jdk` for more information. diff --git a/SDKUserGuide/mmm.rst b/SDKUserGuide/mmm.rst index 29a9874b0..c57c95f2b 100644 --- a/SDKUserGuide/mmm.rst +++ b/SDKUserGuide/mmm.rst @@ -247,7 +247,7 @@ SDK Configuration By default, when starting an empty workspace, the SDK is configured to import dependencies from :ref:`MicroEJ Central Repository ` and to publish built modules to a local directory. The repository configuration is stored in a :ref:`settings file ` (``ivysettings.xml``), and the default one -is located at ``$USER_HOME\.microej\microej-ivysettings-[VERSION].xml`` +is located at ``\.microej\microej-ivysettings-[VERSION].xml`` .. _mmm_preferences_page: diff --git a/SDKUserGuide/mmmRepository.rst b/SDKUserGuide/mmmRepository.rst index db701c203..5e2333ea9 100644 --- a/SDKUserGuide/mmmRepository.rst +++ b/SDKUserGuide/mmmRepository.rst @@ -41,7 +41,7 @@ provided by default in MicroEJ SDK configuration, which is connected to :ref:`Mi -The ``MicroEJChainResolver`` is a URL resolver defined in ``$USER_HOME\.microej\microej-ivysettings-[VERSION].xml`` that points to MicroEJ Central Repository. +The ``MicroEJChainResolver`` is a URL resolver defined in ``\.microej\microej-ivysettings-[VERSION].xml`` that points to MicroEJ Central Repository. .. _module_repository_consistency: diff --git a/VEEWearUserGuide/android/installation.rst b/VEEWearUserGuide/android/installation.rst index 3c4b96e8f..b724d0b7a 100644 --- a/VEEWearUserGuide/android/installation.rst +++ b/VEEWearUserGuide/android/installation.rst @@ -26,7 +26,7 @@ Configure Repositories The :ref:`SDK 6 repositories configuration ` references the MicroEJ module repositories which are required for resolving the SDK Gradle plugins and modules. Working with Android plugins and modules involves extending this configuration to include additional repositories that are essential for Android development. -- download and copy :download:`this file ` in ``$USER_HOME/.gradle/init.d/``. +- download and copy :download:`this file ` in ``/.gradle/init.d/``. .. | Copyright 2008-2025, MicroEJ Corp. Content in this space is free