[ 
https://issues.apache.org/jira/browse/SOLR-18540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated SOLR-18540:
----------------------------------
    Labels: pull-request-available  (was: )

> gradlew fails under Git Bash (MSYS) with "Could not find or load main class 
> org.gradle.wrapper.GradleWrapperMain" because APP_HOME and CLASSPATH are 
> converted with cygpath twice
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-18540
>                 URL: https://issues.apache.org/jira/browse/SOLR-18540
>             Project: Solr
>          Issue Type: Bug
>          Components: Gradle
>            Reporter: Nick Shanin
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 🤖 _AI text below_ 🤖 _(posted on behalf of Nick Shanin)_
> Running {{gradlew}} from Git Bash (MSYS or MINGW) on Windows fails before the 
> build starts. {{gradlew}} converts {{APP_HOME}} and {{CLASSPATH}} to Windows 
> form twice: {{cygpath --path}} treats its input as a colon-separated list, so 
> the second conversion splits at the drive-letter colon and produces a 
> classpath like {{C;C:/Users/.../gradle-wrapper.jar}}, and the JVM cannot find 
> the wrapper main class. This was confirmed by a run on a Windows Git Bash 
> host: on unmodified main, {{gradlew -version}} failed with "Could not find or 
> load main class org.gradle.wrapper.GradleWrapperMain" and exit code 1, and 
> with the fix below it printed Gradle 9.7.0 and exited 0. Only {{gradlew 
> -version}} was run, so the fix is verified for wrapper startup.
> The fix is to delete the second conversion, lines 216 to 218 of {{gradlew}}, 
> keeping the {{JAVACMD}} conversion at line 219. No other change is needed: 
> {{APP_HOME}} is already in Windows form from the first conversion at line 
> 159, and {{CLASSPATH}} is built from it. {{gradlew.bat}} has no {{cygpath}} 
> conversion and is not affected.
> AI agents assisted with research, implementation, review, and drafting. Nick 
> Shanin directed the work and takes responsibility for the above text.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to