Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot update to version 3.4.0 \AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\ not found #3895

Open
drakgoku opened this issue Dec 17, 2024 · 9 comments

Comments

@drakgoku
Copy link

drakgoku commented Dec 17, 2024

I just updated my spring boot parent project in build.gradle.kts from 3.3.5 to 3.4.0 and I get this error in red:

img
img

Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.8-bin.zip'. The specified initialization script 'C:\Users\...\AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\config_win\org.eclipse.osgi\58\0\.cp\gradle\init\init.gradle' does not exist.Java(0)

I can compile fine and do a clean "./gradlew clean build".

So I decided to update the gradle:
./gradlew wrapper --gradle-version 8.11.1" in the parent project.

Still giving me the same error.

Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.11.1-bin.zip'.The specified initialization script 'C:\Users\...\AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\config_win\org.eclipse.osgi\58\0\.cp\gradle\init\init.gradle' does not exist.Java(0)

I can still compile fine and do a clean "./gradlew clean build".

What's going on? I don't have that document you're asking for and I don't know what it is. What there is is a version "1.37.0" but not a 1.36. Although I repeat, I have no idea what these config files are.

img

When I download a "new project from spring init", the spring boot version 3.4.0 and gradle 8.11.1 work correctly.

1 - New project: everything is fine
img
2 - Existing project: everything is wrong
img

What happens?

Note: I have tried:

  • deleting the "C:\Users.....gradle" folder, but rebuilding it has not solved the problem either.
@drakgoku drakgoku changed the title Version 3.4.0 \AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\ not found Spring Boot update to version 3.4.0 \AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\ not found Dec 17, 2024
@iwangbowen
Copy link

It happened to me many times that the extension reports many problems mistakenly

@drakgoku
Copy link
Author

drakgoku commented Dec 18, 2024

I think the error is more of gradle and redhat gets confused with it.

The solution I think I found is:
1 - Delete the gradle-wrapper.jar download it from the official website or directly download a new spring boot project and copy that gradle-wrapper.jar to your project in gradle\wrapper
2 - Manually change to the latest version:
(old)distributionUrl=https://services.gradle.org/distributions/gradle-8.8-bin.zip to ->
(new - current)distributionUrl=https://services.gradle.org/distributions/gradle-8.11.1-bin.zip

3 - All projects / subprojects
./gradlew wrapper --gradle-version 8.11.1

(Optional) - Close or open / reload the project so that gradle takes effect.

Can I do a build? yes, but with warnings

[Incubating] Problems report is available at: file:///E:/Projects/Project%..../..../build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

This is a headache.
In my case, not having Java installed, I have had to do more things.

I'm going to link it to gradle and let them see it.

@snjeza
Copy link
Contributor

snjeza commented Dec 18, 2024

@drakgoku

The specified initialization script 'C:\Users...\AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\config_win\org.eclipse.osgi\58\0.cp\gradle\init\init.gradle' does not exist.Java(0)

Your VS Code installation is broken.

Could you try the following:

  • exit VS Code
  • remove C:\Users...\AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0
  • start VS Code

@drakgoku
Copy link
Author

drakgoku commented Dec 18, 2024

@snjeza

Your VS Code installation is broken.

It's not broken. Latest version is 1.96.0 and works fine for all projects.

Could you try the following:

  • exit VS Code
  • remove C:\Users...\AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0
  • start VS Code

If you notice, I already do it in the note of the first post. Gradle always restores the same version. Gradle is still incorrect and RedHat gets lost thinking that it is pointing to the most recent version when in reality the project is in 3.4.0 and gradle in 8.11.1 is pointing to 3.3.5 while redhad -> understands that it is 1.36.0 (since it's RedHat that detects gradle, how does it detect it? I have no idea, I don't know the internal workings.)

It's not a simple VSC or RedHat cache issue.

It's a direct Gradle issue.

Here is my full output when I updated to the latest version with "./gradlew wrapper --gradle-version 8.11.1" in the parent project."

[
    {
        "resource": "/E:/Projects/Project ....../............/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "The project cannot be built until build path errors are resolved",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "964",
        "severity": 8,
        "message": "The container 'Project and External Dependencies' references non existing library 'C:\\Users\\......\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter\\3.3.5\\16b7a9acf1918a8f763e871ada3794e9ffd4a980\\spring-boot-starter-3.3.5.jar'",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/e:/Projects/Project ....../............/build.gradle.kts",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.11.1-bin.zip'.\r\nThe specified initialization script 'C:\\Users\\......\\AppData\\Roaming\\Code\\User\\globalStorage\\redhat.java\\1.36.0\\config_win\\org.eclipse.osgi\\58\\0\\.cp\\gradle\\init\\init.gradle' does not exist.",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "964",
        "severity": 8,
        "message": "The container 'Project and External Dependencies' references non existing library 'C:\\Users\\......\\.gradle\\caches\\modules-2\\files-2.1\\org.projectlombok\\lombok\\1.18.34\\ec547ef414ab1d2c040118fb9c1c265ada63af14\\lombok-1.18.34.jar'",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "The project cannot be built until build path errors are resolved",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "964",
        "severity": 8,
        "message": "The container 'Project and External Dependencies' references non existing library 'C:\\Users\\......\\.gradle\\caches\\modules-2\\files-2.1\\org.projectlombok\\lombok\\1.18.34\\ec547ef414ab1d2c040118fb9c1c265ada63af14\\lombok-1.18.34.jar'",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "The project cannot be built until build path errors are resolved",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    }
]
2
Error:
"[
    {
        "resource": "/E:/Projects/Project ....../............/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "The project cannot be built until build path errors are resolved",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "964",
        "severity": 8,
        "message": "The container 'Project and External Dependencies' references non existing library 'C:\\Users\\......\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter\\3.3.5\\16b7a9acf1918a8f763e871ada3794e9ffd4a980\\spring-boot-starter-3.3.5.jar'",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/e:/Projects/Project ....../............/build.gradle.kts",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.11.1-bin.zip'.\r\nThe specified initialization script 'C:\\Users\\......\\AppData\\Roaming\\Code\\User\\globalStorage\\redhat.java\\1.36.0\\config_win\\org.eclipse.osgi\\58\\0\\.cp\\gradle\\init\\init.gradle' does not exist.",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "964",
        "severity": 8,
        "message": "The container 'Project and External Dependencies' references non existing library 'C:\\Users\\......\\.gradle\\caches\\modules-2\\files-2.1\\org.projectlombok\\lombok\\1.18.34\\ec547ef414ab1d2c040118fb9c1c265ada63af14\\lombok-1.18.34.jar'",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "The project cannot be built until build path errors are resolved",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "964",
        "severity": 8,
        "message": "The container 'Project and External Dependencies' references non existing library 'C:\\Users\\......\\.gradle\\caches\\modules-2\\files-2.1\\org.projectlombok\\lombok\\1.18.34\\ec547ef414ab1d2c040118fb9c1c265ada63af14\\lombok-1.18.34.jar'",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    },
    {
        "resource": "/E:/Projects/Project ....../............/......service/",
        "owner": "_generated_diagnostic_collection_name_#8",
        "code": "0",
        "severity": 8,
        "message": "The project cannot be built until build path errors are resolved",
        "source": "Java",
        "startLineNumber": 1,
        "startColumn": 1,
        "endLineNumber": 1,
        "endColumn": 1
    }
]

Please take my advice for the next person who has the same problem and put the solution away.

VSC and RedHat are not to blame.

I thought RedHat was the culprit. But in this case it has nothing to do with it.

@snjeza
Copy link
Contributor

snjeza commented Dec 18, 2024

If you notice, I already do it in the note of the first post. Gradle always restores the same version.

Is there C:\Users\...\AppData\Roaming\Code\User\globalStorage\redhat.java\<vscode-java_version>\config_win\org.eclipse.osgi\58\0\.cp\gradle\init\init.gradle ?

Java LS creates this file.

@drakgoku
Copy link
Author

That file is generated by someone. Be it Java, Gradle or RedHat and it doesn't solve the problem by removing it.

The problem is that gradle is not pointing correctly.

Look at my last logs.

Resource 2
"message": "The container 'Project and External Dependencies' references non existing library 'C:\\Users\\......\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter\\3.3.5\\16b7a9acf1918a8f763e871ada3794e9ffd4a980\\spring-boot-starter-3.3.5.jar'",

The messages are from 3.3.5. But that is incorrect. Actually my project was already at version 3.4.0 of SB and 8.11.1 of Gradle.

Resource 3
"message": "Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.11.1-bin.zip'.\r\nThe specified initialization script 'C:\\Users\\......\\AppData\\Roaming\\Code\\User\\globalStorage\\redhat.java\\1.36.0\\config_win\\org.eclipse.osgi\\58\\0\\.cp\\gradle\\init\\init.gradle' does not exist.",

It's something strange I know.

@snjeza
Copy link
Contributor

snjeza commented Dec 19, 2024

Resource 3
"message": "Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.11.1-bin.zip'.\r\nThe specified initialization script 'C:\Users\......\AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\config_win\org.eclipse.osgi\58\0\.cp\gradle\init\init.gradle' does not exist.",

C:\\Users\\......\\AppData\\Roaming\\Code\\User\\globalStorage\\redhat.java\\1.36.0\\config_win\\org.eclipse.osgi\\58\\0\\.cp\\gradle\\init\\init.gradle must exist. This file is copied from https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/gradle/init/init.gradle
Could you check it?

@drakgoku
Copy link
Author

drakgoku commented Dec 19, 2024

As I mentioned in the first post, I only get version 1.37
img

Currently, removing gradle-wrapper.jar and taking that same jar from the latest Spring Boot project (current 8.11.1) solved the problem.
I don't know if internally Spring Boot and gradle have some synergy, that is, the detection and creation of internal files depending on the versions. But Gradle was not pointing well and unfortunately I can't reproduce it and I can't give you the old project so you can check it since it's private.

At most, to reproduce it, what could be done is to move from a 3.3.6 project, change the wrapper to version 8.8 (since officially Spring Boot uses 8.11.1) from https://services.gradle.org/distributions/
Then change Spring Boot to version 3.4.0 and then try to run the update command ./gradlew wrapper --gradle-version x.x.x and check if there is any desync between updating to the new version and creating.

Since it could happen in the future when changing the Spring Boot version and Gradle could break again.

By the way, I saw this post while trying to fix the error, I don't know if it has anything to do with it as well although the user doesn't provide much information:
Android
"Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.0.2-all.zip'. The specified initialization script 'C:\Users\ASUS\AppData\Roaming\Code\User\globalStorage\redhat.java\1.36.0\config_win\org.eclipse.osgi\58\0.cp\gradle\init\init.gradle' does not exist."

It points to the same file and he is in Android and I am in Spring Boot. Could it be a coincidence?

@drakgoku
Copy link
Author

drakgoku commented Dec 19, 2024

@jbartok has closed my post gradle/gradle#31823. The least suitable person in Gradle. If we have incompetents like that, I think we're going to drag the error along. Maybe @jbartok is a cleaning person and pretends to be a programmer, I don't know. But his answer killed me.

My problem:
img
The answer of a genius.
img

Having this guy do "commits" in the company is like having an elephant pounding on the keyboard. I wouldn't even let him do a "commit" to the development branch without supervising him first.

Anyway, another problem that falls into oblivion thanks to the genius of @jbartok. I wonder what kind of excuse he will use? "context was missing"
This reminded me of stackoverflow. We can say, it has made me a "stackoverflow" hahaha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants