You are not logged in.

#1 2024-06-01 16:40:34

ihitmani
Member
Registered: 2021-05-03
Posts: 83

[SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

hi, for some reasons gradle does not work, need help.

java.lang.IllegalArgumentException: Cannot find JAR 'asm-9.1.jar' required by module 'gradle-base-services' using classpath or distribution directory '/usr/share/java/gradle'
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.findDependencyJar(DefaultModuleRegistry.java:358)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.findDependencyJars(DefaultModuleRegistry.java:220)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.module(DefaultModuleRegistry.java:210)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadOptionalModule(DefaultModuleRegistry.java:190)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadModule(DefaultModuleRegistry.java:174)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.getModule(DefaultModuleRegistry.java:154)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.getModules(DefaultModuleRegistry.java:228)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.access$100(DefaultModuleRegistry.java:50)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry$DefaultModule.getRequiredModules(DefaultModuleRegistry.java:393)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry$DefaultModule.collectRequiredModules(DefaultModuleRegistry.java:431)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry$DefaultModule.getAllRequiredModules(DefaultModuleRegistry.java:414)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry$DefaultModule.getAllRequiredModulesClasspath(DefaultModuleRegistry.java:421)
	at org.gradle.api.internal.DefaultClassPathProvider.findClassPath(DefaultClassPathProvider.java:31)
	at org.gradle.api.internal.DefaultClassPathRegistry.getClassPath(DefaultClassPathRegistry.java:35)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:49)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:34)

Last edited by ihitmani (2025-06-02 22:02:06)

Offline

#2 2024-06-01 17:22:21

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,641

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Perhaps a smidge of context?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2024-06-01 20:23:52

cryptearth
Member
Registered: 2024-02-03
Posts: 2,186

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

off-topic

As a Java-dev it turns my guts insight-out seeing this completely wrong reflections call just to call on start-up method from another. I hope noone using gradle writes code that's as ugly as this start-up code itself. If you even think about reflections you certainly don't need them as you try to do what should not be done!
For anyone who want's to know how to propetly work with dynamic loadables like "plug-ins": Have a look at the ServiceLoader api - it's designed for exactly such use cases.

Offline

#4 2024-06-02 08:28:54

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

ewaller wrote:

Perhaps a smidge of context?

sure, usually I use maven,but  I received new project based on gradle. I had gradle installed on my machine. When I tried to use it from console, it failed to start. Maven works just fine, but gradle. System is up to date.

Last edited by ihitmani (2024-06-02 08:30:23)

Offline

#5 2024-06-02 10:19:28

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

usr/share/java/gradle/lib/asm-9.7.jar
usr/share/java/gradle/lib/asm-commons-9.7.jar
usr/share/java/gradle/lib/asm-tree-9.7.jar

Gradle version in extra repo is 8.8 and has only asm 9.7 .
Output of

pacman -Qikk gradle

?
What command are you running that gives that output ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2024-06-03 07:03:10

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:
usr/share/java/gradle/lib/asm-9.7.jar
usr/share/java/gradle/lib/asm-commons-9.7.jar
usr/share/java/gradle/lib/asm-tree-9.7.jar

Gradle version in extra repo is 8.8 and has only asm 9.7 .
Output of

pacman -Qikk gradle

?
What command are you running that gives that output ?

I run "gradle" in console, and have that output

pacman -Qikk gradle
Name            : gradle
Version         : 8.8-1
Description     : Powerful build system for the JVM
Architecture    : any
URL             : https://gradle.org/
Licenses        : Apache
Groups          : None
Provides        : None
Depends On      : java-environment<=21  bash  which  coreutils  findutils  sed
Optional Deps   : gradle-doc: gradle documentation
                  gradle-src: gradle sources
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 145.79 MiB
Packager        : Frederik Schwan <freswa@archlinux.org>
Build Date      : Sat 01 Jun 2024 11:19:47 AM EEST
Install Date    : Sat 01 Jun 2024 07:36:11 PM EEST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

warning: gradle: /usr/bin (Permissions mismatch)
warning: gradle: /usr/share (UID mismatch)
warning: gradle: /usr/share/java (UID mismatch)
warning: gradle: /usr/share/java/gradle (UID mismatch)
warning: gradle: /usr/share/java/gradle/lib (UID mismatch)
warning: gradle: /usr/share/java/gradle/lib/plugins (UID mismatch)
gradle: 284 total files, 6 altered files

Last edited by ihitmani (2024-06-03 07:04:10)

Offline

#7 2024-06-03 07:32:21

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

please post the outputs of

$ archlinux-java status
$ command -V gradle
$ command -v gradle
$ stat /usr/bin
$ stat /usr/bin/gradle
$ stat /usr/share/java/gradle/lib/plugins

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2024-06-03 08:06:32

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

archlinux-java status
Available Java environments:
  java-11-openjdk
  java-17-openjdk (default)
  java-22-openjdk
  java-8-openjdk

command -V gradle
gradle is /usr/bin/gradle

command -v gradle
/usr/bin/gradle

stat /usr/bin
  File: /usr/bin
  Size: 135168    	Blocks: 272        IO Block: 4096   directory
Device: 259,7	Inode: 59768837    Links: 7
Access: (4755/drwsr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-06-03 09:48:25.120991310 +0300
Modify: 2024-06-01 19:36:17.211698138 +0300
Change: 2024-06-01 19:36:17.211698138 +0300
 Birth: 2022-06-28 19:31:27.519887367 +0300

stat /usr/bin/gradle
  File: /usr/bin/gradle -> /usr/share/java/gradle/bin/gradle
  Size: 33        	Blocks: 0          IO Block: 4096   symbolic link
Device: 259,7	Inode: 59768895    Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-06-03 10:02:39.015766594 +0300
Modify: 2024-06-01 11:19:47.000000000 +0300
Change: 2024-06-01 19:36:11.171638852 +0300
 Birth: 2024-06-01 19:36:11.171638852 +0300

stat /usr/share/java/gradle/lib/plugins
  File: /usr/share/java/gradle/lib/plugins
  Size: 12288     	Blocks: 24         IO Block: 4096   directory
Device: 259,7	Inode: 1712931     Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/       v)   Gid: (    0/    root)
Access: 2024-06-01 19:38:18.196665927 +0300
Modify: 2024-06-01 19:36:11.391641042 +0300
Change: 2024-06-01 19:36:11.391641042 +0300
 Birth: 2022-06-28 19:36:41.216542868 +0300

Offline

#9 2024-06-03 09:16:21

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

hmm, those outputs look normal to me.
The change time is probably when you updated gradle to latest version (8.8) .

Delete or move away ~/.gradle , then rerun gradle from console .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#10 2024-06-03 16:27:34

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

hmm, those outputs look normal to me.
The change time is probably when you updated gradle to latest version (8.8) .

Delete or move away ~/.gradle , then rerun gradle from console .

Already tried to delete this folder, this method does not work

Offline

#11 2024-06-04 07:51:46

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Is there a gradle build present in the folder you are running the command from ?

If yes, run gradle from a folder without any gradle files present.
(create a new empty one if needed )
Does that give the same error ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#12 2024-06-04 10:17:23

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

Is there a gradle build present in the folder you are running the command from ?

If yes, run gradle from a folder without any gradle files present.
(create a new empty one if needed )
Does that give the same error ?

Tried, it did not help. I run it from empty filder

Last edited by ihitmani (2024-06-04 10:17:54)

Offline

#13 2024-06-04 10:48:40

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

ASM 9.1 was the first version with jdk 17 support, maybe that is related .

With root rights run archlinux-java set java-22-openjdk .

run gradle and post full output.
(there should be more then just the error message).


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#14 2024-06-04 16:40:59

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

ASM 9.1 was the first version with jdk 17 support, maybe that is related .

With root rights run archlinux-java set java-22-openjdk .

run gradle and post full output.
(there should be more then just the error message).

nothing changed, message the same

Offline

#15 2024-06-05 07:34:50

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

java often has issues with wayland.

Are you using X or wayland ?
Which WM/DE/compositor ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#16 2024-06-05 07:44:31

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

java often has issues with wayland.

Are you using X or wayland ?
Which WM/DE/compositor ?

I use X and xfce

Offline

#17 2024-06-05 08:19:19

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Run

$ gradle --info > gradle-info-log.txt 2>&1
$ gradle --debug > gradle-debug-log.txt 2>&1

Check both files , if they don't give more information :

Let's try to figure out if the issue is systemwide or in user config.
create a new linux user (for testing) . configure as little as possible and run gradle as that user.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#18 2024-06-05 08:41:23

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

Run

$ gradle --info > gradle-info-log.txt 2>&1
$ gradle --debug > gradle-debug-log.txt 2>&1

Check both files , if they don't give more information :

Let's try to figure out if the issue is systemwide or in user config.
create a new linux user (for testing) . configure as little as possible and run gradle as that user.

I created user "tgradle" assign groups users and wheel, set password. I changed user with commmand su userName. It shows the same message under mentioned user with different home dir. Any other ideas ?

Offline

#19 2024-06-05 09:44:19

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

logging out as your normal user and logging in as the new user is preferred method , as su gives a mixed environment .

I hope you did add --login to the su invocation ?
If not, try with another fresh user.

Did gradle-info-log.txt and gradle-debug-log.txt from your normal user give more info then just the error message ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#20 2024-06-05 10:22:45

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

logging out as your normal user and logging in as the new user is preferred method , as su gives a mixed environment .

I hope you did add --login to the su invocation ?
If not, try with another fresh user.

Did gradle-info-log.txt and gradle-debug-log.txt from your normal user give more info then just the error message ?

just tried(tty), does not work, message the same

Last edited by ihitmani (2024-06-05 10:23:32)

Offline

#21 2024-06-05 11:49:02

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

one more attempt :

Post the outputs of

$ /usr/share/java/gradle/bin/gradle -v
$ gradle -v

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#22 2024-06-05 12:34:08

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

one more attempt :

Post the outputs of

$ /usr/share/java/gradle/bin/gradle -v
$ gradle -v

nothing work. Just to note, maybe it is related, when I update system, I have this warnings from pacman:

(1/1) reinstalling gradle                                                                      [########################################################] 100%
warning: directory permissions differ on /usr/bin/
filesystem: 4755  package: 755



 /usr/share/java/gradle/bin/gradle -v
java.lang.IllegalArgumentException: Cannot find JAR 'asm-9.1.jar' required by module 'gradle-base-services' using classpath or distribution directory '/usr/share/java/gradle'


gradle -v
java.lang.IllegalArgumentException: Cannot find JAR 'asm-9.1.jar' required by module 'gradle-base-services' using classpath or distribution directory '/usr/share/java/gradle'

Last edited by ihitmani (2024-06-05 12:35:18)

Offline

#23 2024-06-06 09:31:37

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,085

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Looked again at the outputs in #8 and I was wrong : they do look weird .

/usr/bin has 4755 permissions .  the 4 corresponds to the setuid-bit which has no effect on directories at all !
Default permissioin for /usr/bin should be 0755 .

stat /usr/share/java/gradle/lib/plugins

Access: (0755/drwxr-xr-x)  Uid: ( 1000/       v)   Gid: (    0/    root)

folders in /usr/share have no business being owned by users !

post the outputs of

$ stat /usr/bin /usr/share /usr/share/java /usr/share/java/gradle /usr/share/java/gradle/lib /usr/share/java/gradle/lib/plugin
# pacman -Qkk | grep -v ', 0 altered files'

(the second one must be run with root rights to reduce number of messages .

Especially the 2nd output could still be long , see https://wiki.archlinux.org/title/List_o … ted_client for methods to upload text outputs to public storage.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#24 2024-06-06 12:06:38

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Lone_Wolf wrote:

Looked again at the outputs in #8 and I was wrong : they do look weird .

/usr/bin has 4755 permissions .  the 4 corresponds to the setuid-bit which has no effect on directories at all !
Default permissioin for /usr/bin should be 0755 .

stat /usr/share/java/gradle/lib/plugins

Access: (0755/drwxr-xr-x)  Uid: ( 1000/       v)   Gid: (    0/    root)

folders in /usr/share have no business being owned by users !

post the outputs of

$ stat /usr/bin /usr/share /usr/share/java /usr/share/java/gradle /usr/share/java/gradle/lib /usr/share/java/gradle/lib/plugin
# pacman -Qkk | grep -v ', 0 altered files'

(the second one must be run with root rights to reduce number of messages .

Especially the 2nd output could still be long , see https://wiki.archlinux.org/title/List_o … ted_client for methods to upload text outputs to public storage.

 stat /usr/bin /usr/share /usr/share/java /usr/share/java/gradle /usr/share/java/gradle/lib /usr/share/java/gradle/lib/plugin
  File: /usr/bin
  Size: 135168    	Blocks: 272        IO Block: 4096   directory
Device: 259,7	Inode: 59768837    Links: 7
Access: (4755/drwsr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-06-06 15:00:45.798288720 +0300
Modify: 2024-06-06 15:00:45.798288720 +0300
Change: 2024-06-06 15:00:45.798288720 +0300
 Birth: 2022-06-28 19:31:27.519887367 +0300
  File: /usr/share
  Size: 12288     	Blocks: 24         IO Block: 4096   directory
Device: 259,7	Inode: 59768843    Links: 272
Access: (0755/drwxr-xr-x)  Uid: ( 1000/       v)   Gid: (    0/    root)
Access: 2024-06-06 14:59:43.232039138 +0300
Modify: 2024-06-01 19:36:17.208364774 +0300
Change: 2024-06-01 19:36:17.208364774 +0300
 Birth: 2022-06-28 19:31:27.519887367 +0300
  File: /usr/share/java
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 259,7	Inode: 1181108     Links: 7
Access: (0755/drwxr-xr-x)  Uid: ( 1000/       v)   Gid: (    0/    root)
Access: 2024-06-06 14:59:43.232039138 +0300
Modify: 2024-05-25 11:52:50.924199498 +0300
Change: 2024-05-25 11:52:50.924199498 +0300
 Birth: 2022-06-28 19:35:24.269878939 +0300
  File: /usr/share/java/gradle
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 259,7	Inode: 1712926     Links: 5
Access: (0755/drwxr-xr-x)  Uid: ( 1000/       v)   Gid: (    0/    root)
Access: 2024-06-06 15:00:45.798288720 +0300
Modify: 2024-06-06 15:00:45.798288720 +0300
Change: 2024-06-06 15:00:45.798288720 +0300
 Birth: 2022-06-28 19:36:41.216542868 +0300
  File: /usr/share/java/gradle/lib
  Size: 12288     	Blocks: 24         IO Block: 4096   directory
Device: 259,7	Inode: 1712930     Links: 4
Access: (0755/drwxr-xr-x)  Uid: ( 1000/       v)   Gid: (    0/    root)
Access: 2024-06-06 15:00:45.798288720 +0300
Modify: 2024-06-06 15:00:46.034953820 +0300
Change: 2024-06-06 15:00:46.034953820 +0300
 Birth: 2022-06-28 19:36:41.216542868 +0300
stat: cannot statx '/usr/share/java/gradle/lib/plugin': No such file or directory

here it is second command:
https://drive.google.com/file/d/1mxPV03 … sp=sharing

Offline

#25 2024-06-06 13:07:58

cryptearth
Member
Registered: 2024-02-03
Posts: 2,186

Re: [SOLVED]gradle does not work Cannot find JAR 'asm-9.1.jar'

Maybe I missed it: Have you tried to uninstall gradle by pacman -R gradle and clean everything left behind? Maybe some earlier update failed and the issue is caused by inconsistencies.

Offline

Board footer

Powered by FluxBB