Using Git to run powershelll in jdk application failed

Hi I am trying to install WALNUT (Prover) software. It is written for linux but should be doable on Windows 11. I installed jdk-22. I then installed GIT. I then ran the build file ( I got the following error message: "A problem occurred configuring root project ‘Walnut-main-extracted’.

> Could not open cp_proj generic class cache for build file 'C:\Users\Russe\Downloads\Walnut-main-extracted\build.gradle' (C:\Users\Russe\.gradle\caches\7.5.1\scripts\c3z8tlvdbsfe7otjnai08oslm).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 66"

Note: I extracted the walnut-zip file to a folder walnut-main-extracted. The instructions ask to run the file (after installing git I entered at a command line prompt “” and got the above message. Thanx Russell Hendel

You are trying to run Gradle 7.5.1 with Java 22, that is not supported: Compatibility Matrix

Thank you. I downloaded jdk v18 (and changed my path variables) and reran. BUILD.SH resulted in a message of “successful”. BUILD.SH with the -t flag (for tests) produced 2 failed tests in 620. However, despite the build the application would not run (after going to the bin directory ,Java Main.prover is supposed to start the application). The error message I received was "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 Command-Line Interface"

This applied to older versions of Walnut (v6) as well as new versions (v8). I tried using jdk20 but this resulted in a long list of java errors (consistent with your observation that gradle 7.5.1 is imcompatable with the bigger jdk versions).

I am uncertain how to proceed with dealing the deprecation warnings

Those deprecation warnings will not make your build fail unless you configured to fail on warnings.
So as long as you are not using Gradle 8, where those warnings might become errors, they will not make anything not run.
There is most likely another problem.
But without further information it is hard to tell from here.

Thanx. So my problem was running the application with the command Java Prover.Main. Since that didn’t work I directly went into the directory where the Prover.cls existed. When I typed Java Prover I received an error message explaining that that Prover was built with Java class 66 while I was using Java class 64. Class 66 java statements require jdk-22. So I change my path variable again; the error message stopped but it still didnt run. Not sure what to do (Appreciate your empathy that is not too much to go on). I might try with Eclipse that is compatible with jdk-22 to see if they are friendlier with errors [In passing I think the underlying problem is that I am trying to do something in windows that was meant for Linux since other uses do not experience these difficulties but I am not sure]

Assuming you talk about GitHub - firetto/Walnut, uses ./gradlew, which uses the Java you have configured via JAVA_HOME. then uses java, which uses the Java you have in your PATH.

If I have JAVA_HOME set to Java 17 and PATH to Java 11, I get the message that it was compiled for Java 17 and cannot run on 11.

So from your message that would mean you have Java 22 in JAVA_HOME and Java 20 in your PATH.

Maybe you changed to Java 20 but then just run without doing again or something like that?

You could also unset JAVA_HOME while building, because then gradlew will also use the java from PATH, so for example running JAVA_HOME= ./ to build. (the space after the = is important, don’t omit it)

PROBLEM SOLVED! Thanx for all your help. To answer your questions and summarize: Whenever I changed PATH I simultaneously change JAVA_HOME. I always tested them at a (new) command prompt with PATH and echo %JAVA_HOME% (I though that obvious but should have mentioned it).

You solved my problem by pointing out that I shouldn’t be using jdk-22 with gradle 7.5 and also pointing out that the deprecation didn’t automatically fail the process. The “instructions” I had seen told me to type Java Prover.Main after changing to the bin directory. This failed. Instead I directly typed (without re-running the BUILD I had already done). It opened a walnut window and I was able to successfully run a simple routine in both Walnut 6 and Walnut 8.

To answer your other questions/comments I did alot of web browsing and found I should install git if I am trying to implement a Linux application in windows.

Again: Thanx. It is very useful to know about Git when I try and use Linux applications in windows in the future. Also (though I theoretically knew it) it is always good to be reminded that the most advanced form of something doesn’t necessarily imply compatibility with other software used

1 Like

For “Linux applications” Git does not really help actually.
You do not have a Linux application there.
You have a Java application, that has some helper Bash scripts.
For that, Git is most often fine, as it comes with a Bash port and ports of some essential Linux commandline tools.
You would not be able to build or run actual Linux applications.
For that, you should use WSL where a real Linux is running in parallel to Windows basically.
There you indeed can run also real Linux applications, because you are inside a real Linux distribution.