Gradle does not build on RHEL/Fedora Linux

Tried using make and ./gradlew (As per the projects README).

Tried using Sudo, and different gradlew arguments, but kept getting this same issue on RHEL 9.4.
I get a cache error on Fedora, trie marking cache folders as old, but didn’t work. I would also like this to work when using the make command, as I am working on packaging this IP Scanner.

Link to project: GitHub - angryip/ipscan: Angry IP Scanner - fast and friendly network scanner

I am unsure how to proceed here, and don’t have much experience with Gradle. If anyone could point me in the right direction, that would be appreciated.

Thank you!

RHEL logs: (Sudo ./gradlew current, but I get this same error for all)

> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :linux64.min FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':linux64.min'.
> java.io.IOException: Please correct the above warnings first.

* 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 8.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/7.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 25s
4 actionable tasks: 4 executed

Fedora logs: (sudo ./gradlew all, but I get this same error for all)

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'ipscan'.
> Could not open cp_proj generic class cache for build file '/home/owen/Documents/Projects/ipscan/build.gradle' (/root/.gradle/caches/7.6/scripts/446icnjucu6qaz9qd41o5kbol).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

* 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

Tried using Sudo

Never do so, you just corrupt your cache files with that, so that you can only use Gradle through sudo in the future as without you will miss permission to read and modify the files.

I’d recommend you delete all Gradle caches where you did use sudo and never do it again. :slight_smile:

I would also like this to work when using the make command, as I am working on packaging this IP Scanner.

As the Makefile does literally nothing except forwarding to gradlew, as soon as you got gradlew working, also make will work.

The Fedora issue is, that you use Java 21 to run a Gradle 7.6 build, which is not supported: Compatibility Matrix

About the RHEL issue, did you follow the suggestions in the error message?
If no, why not?
If yes, why did you not provide the additional information? Especially the --stracktrace or much better the build --scan URL.

I see, I’ll start over with the cache and stop using sudo. Will check the compatability matrix, that seems to point to a fix.

For the RHEL laptop, I can try the further troubleshooting but I would like this to work on Fedora, so I’ll work on that first.

Thanks!

1 Like