Compile own version #2

Closed
opened 2024-11-11 15:55:41 +01:00 by Benjamin_Loison · 7 comments

On Debian 12 GNOME Pegasus:

git clone --depth 1 git@github.com:termux/termux-widget.git
Output:
Cloning into 'termux-widget'...
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 64 (delta 4), reused 26 (delta 1), pack-reused 0 (from 0)
Receiving objects: 100% (64/64), 281.86 KiB | 965.00 KiB/s, done.
Resolving deltas: 100% (4/4), done.
cd termux-widget/
./gradlew assembleDebug
Output:
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-widget/local.properties'.

* 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

BUILD FAILED in 1s
echo 'sdk.dir=/usr/lib/android-sdk' > local.properties
./gradlew assembleDebug
Output:
> Task :app:processDebugMainManifest
package="com.termux.widget" found in source AndroidManifest.xml: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-widget/app/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

> Task :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':app:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: /usr/lib/android-sdk/platforms/android-30/core-for-system-modules.jar.
         > jlink executable /usr/lib/jvm/java-17-openjdk-amd64/bin/jlink does not exist.

* 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

BUILD FAILED in 16s
26 actionable tasks: 26 executed
./gradlew assembleDebug
Output:
> Task :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':app:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: /usr/lib/android-sdk/platforms/android-30/core-for-system-modules.jar.
         > jlink executable /usr/lib/jvm/java-17-openjdk-amd64/bin/jlink does not exist.

* 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

BUILD FAILED in 1s
13 actionable tasks: 1 executed, 12 up-to-date
sudo apt install jlink
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package jlink
On Debian 12 GNOME *Pegasus*: ```bash git clone --depth 1 git@github.com:termux/termux-widget.git ``` <details> <summary>Output:</summary> ``` Cloning into 'termux-widget'... remote: Enumerating objects: 64, done. remote: Counting objects: 100% (64/64), done. remote: Compressing objects: 100% (54/54), done. remote: Total 64 (delta 4), reused 26 (delta 1), pack-reused 0 (from 0) Receiving objects: 100% (64/64), 281.86 KiB | 965.00 KiB/s, done. Resolving deltas: 100% (4/4), done. ``` </details> ```bash cd termux-widget/ ./gradlew assembleDebug ``` <details> <summary>Output:</summary> ``` FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-widget/local.properties'. * 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 BUILD FAILED in 1s ``` </details> ```bash echo 'sdk.dir=/usr/lib/android-sdk' > local.properties ./gradlew assembleDebug ``` <details> <summary>Output:</summary> ``` > Task :app:processDebugMainManifest package="com.termux.widget" found in source AndroidManifest.xml: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-widget/app/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :app:compileDebugJavaWithJavac FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Could not resolve all files for configuration ':app:androidJdkImage'. > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: /usr/lib/android-sdk/platforms/android-30/core-for-system-modules.jar. > jlink executable /usr/lib/jvm/java-17-openjdk-amd64/bin/jlink does not exist. * 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 BUILD FAILED in 16s 26 actionable tasks: 26 executed ``` </details> ```bash ./gradlew assembleDebug ``` <details> <summary>Output:</summary> ``` > Task :app:compileDebugJavaWithJavac FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Could not resolve all files for configuration ':app:androidJdkImage'. > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: /usr/lib/android-sdk/platforms/android-30/core-for-system-modules.jar. > jlink executable /usr/lib/jvm/java-17-openjdk-amd64/bin/jlink does not exist. * 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 BUILD FAILED in 1s 13 actionable tasks: 1 executed, 12 up-to-date ``` </details> ```bash sudo apt install jlink ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package jlink ``` </details>
Author
Owner

DuckDuckGo search "jlink does not exist".

DuckDuckGo search `"jlink does not exist"`.
Author
Owner

The Stack Overflow answer 75862061:

java -version
Output:
openjdk version "17.0.13" 2024-10-15
OpenJDK Runtime Environment (build 17.0.13+11-Debian-2deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.13+11-Debian-2deb12u1, mixed mode, sharing)
javac
Output:
Command 'javac' not found, did you mean:
  command 'javagc' from deb libbpf-tools
  command 'javacc' from deb javacc
Try: sudo apt install <deb name>
[The Stack Overflow answer 75862061](https://stackoverflow.com/a/75862061): ```bash java -version ``` <details> <summary>Output:</summary> ``` openjdk version "17.0.13" 2024-10-15 OpenJDK Runtime Environment (build 17.0.13+11-Debian-2deb12u1) OpenJDK 64-Bit Server VM (build 17.0.13+11-Debian-2deb12u1, mixed mode, sharing) ``` </details> ```bash javac ``` <details> <summary>Output:</summary> ``` Command 'javac' not found, did you mean: command 'javagc' from deb libbpf-tools command 'javacc' from deb javacc Try: sudo apt install <deb name> ``` </details>
Author
Owner
sudo apt install default-jre
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
default-jre is already the newest version (2:1.17-74).
default-jre set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
```bash sudo apt install default-jre ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done default-jre is already the newest version (2:1.17-74). default-jre set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. ``` </details>
Author
Owner
sudo apt install -y default-jdk
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  default-jdk-headless openjdk-17-jdk openjdk-17-jdk-headless
Suggested packages:
  openjdk-17-demo openjdk-17-source visualvm
The following NEW packages will be installed:
  default-jdk default-jdk-headless openjdk-17-jdk openjdk-17-jdk-headless
0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
Need to get 73.9 MB of archives.
After this operation, 81.2 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 openjdk-17-jdk-headless amd64 17.0.13+11-2~deb12u1 [71.5 MB]
Get:2 http://deb.debian.org/debian bookworm/main amd64 default-jdk-headless amd64 2:1.17-74 [1,108 B]
Get:3 http://deb.debian.org/debian bookworm/main amd64 openjdk-17-jdk amd64 17.0.13+11-2~deb12u1 [2,395 kB]
Get:4 http://deb.debian.org/debian bookworm/main amd64 default-jdk amd64 2:1.17-74 [1,068 B]
Fetched 73.9 MB in 2s (31.8 MB/s)       
Selecting previously unselected package openjdk-17-jdk-headless:amd64.
(Reading database ... 440753 files and directories currently installed.)
Preparing to unpack .../openjdk-17-jdk-headless_17.0.13+11-2~deb12u1_amd64.deb ...
Unpacking openjdk-17-jdk-headless:amd64 (17.0.13+11-2~deb12u1) ...
Selecting previously unselected package default-jdk-headless.
Preparing to unpack .../default-jdk-headless_2%3a1.17-74_amd64.deb ...
Unpacking default-jdk-headless (2:1.17-74) ...
Selecting previously unselected package openjdk-17-jdk:amd64.
Preparing to unpack .../openjdk-17-jdk_17.0.13+11-2~deb12u1_amd64.deb ...
Unpacking openjdk-17-jdk:amd64 (17.0.13+11-2~deb12u1) ...
Selecting previously unselected package default-jdk.
Preparing to unpack .../default-jdk_2%3a1.17-74_amd64.deb ...
Unpacking default-jdk (2:1.17-74) ...
Setting up openjdk-17-jdk-headless:amd64 (17.0.13+11-2~deb12u1) ...
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jdeprscan to provide /usr/bin/jdeprscan (jdeprscan) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jfr to provide /usr/bin/jfr (jfr) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jimage to provide /usr/bin/jimage (jimage) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jlink to provide /usr/bin/jlink (jlink) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jmod to provide /usr/bin/jmod (jmod) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jshell to provide /usr/bin/jshell (jshell) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jhsdb to provide /usr/bin/jhsdb (jhsdb) in auto mode
Setting up openjdk-17-jdk:amd64 (17.0.13+11-2~deb12u1) ...
update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
Setting up default-jdk-headless (2:1.17-74) ...
Setting up default-jdk (2:1.17-74) ...
```bash sudo apt install -y default-jdk ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: default-jdk-headless openjdk-17-jdk openjdk-17-jdk-headless Suggested packages: openjdk-17-demo openjdk-17-source visualvm The following NEW packages will be installed: default-jdk default-jdk-headless openjdk-17-jdk openjdk-17-jdk-headless 0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded. Need to get 73.9 MB of archives. After this operation, 81.2 MB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main amd64 openjdk-17-jdk-headless amd64 17.0.13+11-2~deb12u1 [71.5 MB] Get:2 http://deb.debian.org/debian bookworm/main amd64 default-jdk-headless amd64 2:1.17-74 [1,108 B] Get:3 http://deb.debian.org/debian bookworm/main amd64 openjdk-17-jdk amd64 17.0.13+11-2~deb12u1 [2,395 kB] Get:4 http://deb.debian.org/debian bookworm/main amd64 default-jdk amd64 2:1.17-74 [1,068 B] Fetched 73.9 MB in 2s (31.8 MB/s) Selecting previously unselected package openjdk-17-jdk-headless:amd64. (Reading database ... 440753 files and directories currently installed.) Preparing to unpack .../openjdk-17-jdk-headless_17.0.13+11-2~deb12u1_amd64.deb ... Unpacking openjdk-17-jdk-headless:amd64 (17.0.13+11-2~deb12u1) ... Selecting previously unselected package default-jdk-headless. Preparing to unpack .../default-jdk-headless_2%3a1.17-74_amd64.deb ... Unpacking default-jdk-headless (2:1.17-74) ... Selecting previously unselected package openjdk-17-jdk:amd64. Preparing to unpack .../openjdk-17-jdk_17.0.13+11-2~deb12u1_amd64.deb ... Unpacking openjdk-17-jdk:amd64 (17.0.13+11-2~deb12u1) ... Selecting previously unselected package default-jdk. Preparing to unpack .../default-jdk_2%3a1.17-74_amd64.deb ... Unpacking default-jdk (2:1.17-74) ... Setting up openjdk-17-jdk-headless:amd64 (17.0.13+11-2~deb12u1) ... update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jar to provide /usr/bin/jar (jar) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/javac to provide /usr/bin/javac (javac) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/javap to provide /usr/bin/javap (javap) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jdeprscan to provide /usr/bin/jdeprscan (jdeprscan) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jfr to provide /usr/bin/jfr (jfr) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jimage to provide /usr/bin/jimage (jimage) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jlink to provide /usr/bin/jlink (jlink) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jmod to provide /usr/bin/jmod (jmod) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jps to provide /usr/bin/jps (jps) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jshell to provide /usr/bin/jshell (jshell) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jhsdb to provide /usr/bin/jhsdb (jhsdb) in auto mode Setting up openjdk-17-jdk:amd64 (17.0.13+11-2~deb12u1) ... update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode Setting up default-jdk-headless (2:1.17-74) ... Setting up default-jdk (2:1.17-74) ... ``` </details>
Author
Owner
java --version
Output:
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment (build 17.0.13+11-Debian-2deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.13+11-Debian-2deb12u1, mixed mode, sharing)
```bash java --version ``` <details> <summary>Output:</summary> ``` openjdk 17.0.13 2024-10-15 OpenJDK Runtime Environment (build 17.0.13+11-Debian-2deb12u1) OpenJDK 64-Bit Server VM (build 17.0.13+11-Debian-2deb12u1, mixed mode, sharing) ``` </details>
Author
Owner
javac --version
javac 17.0.13
```bash javac --version ``` ``` javac 17.0.13 ```
Author
Owner
./gradlew assembleDebug
Output:
> Task :app:compileDebugJavaWithJavac
Note: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-widget/app/src/main/java/com/termux/widget/ShortcutFile.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

BUILD SUCCESSFUL in 4s
30 actionable tasks: 5 executed, 25 up-to-date
```bash ./gradlew assembleDebug ``` <details> <summary>Output:</summary> ``` > Task :app:compileDebugJavaWithJavac Note: /home/benjamin_loison/Desktop/BensFolder/DEV/GitHub/termux-widget/app/src/main/java/com/termux/widget/ShortcutFile.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. BUILD SUCCESSFUL in 4s 30 actionable tasks: 5 executed, 25 up-to-date ``` </details>
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/termux-widget#2
No description provided.