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

Add Java 13 support for Gradle projects #1196

Closed
fbricon opened this issue Sep 30, 2019 · 1 comment · Fixed by #1254
Closed

Add Java 13 support for Gradle projects #1196

fbricon opened this issue Sep 30, 2019 · 1 comment · Fixed by #1254

Comments

@fbricon
Copy link
Contributor

fbricon commented Sep 30, 2019

Even after #1179 and #1195, gradle projects (using gradle 6) still fail to be correctly imported in Eclipse/jdt.ls.

Project configurator 'org.eclipse.buildship.configurators.base' failed to configure project 'dummy-java'
Can't convert '13' to enum type 'JavaVersion'
java.lang.IllegalArgumentException: Can't convert '13' to enum type 'JavaVersion'
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.adaptToEnum(ProtocolToModelAdapter.java:180)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.createView(ProtocolToModelAdapter.java:145)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.convert(ProtocolToModelAdapter.java:204)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.access$1500(ProtocolToModelAdapter.java:57)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$AdaptingMethodInvoker.invoke(ProtocolToModelAdapter.java:405)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$PropertyCachingMethodInvoker.invoke(ProtocolToModelAdapter.java:633)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SafeMethodInvoker.invoke(ProtocolToModelAdapter.java:670)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SupportedPropertyInvoker.invoke(ProtocolToModelAdapter.java:694)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$InvocationHandlerImpl.invoke(ProtocolToModelAdapter.java:360)
	at com.sun.proxy.$Proxy54.getSourceLanguageLevel(Unknown Source)
	at org.eclipse.buildship.core.internal.util.gradle.CompatSourceSettings.getSourceLanguageLevel(CompatSourceSettings.java:41)
	at org.eclipse.buildship.core.internal.workspace.JavaSourceSettingsUpdater.update(JavaSourceSettingsUpdater.java:39)
	at org.eclipse.buildship.core.internal.workspace.BaseConfigurator.synchronizeJavaProjectInTransaction(BaseConfigurator.java:118)
	at org.eclipse.buildship.core.internal.workspace.BaseConfigurator.access$000(BaseConfigurator.java:39)
	at org.eclipse.buildship.core.internal.workspace.BaseConfigurator$1.run(BaseConfigurator.java:104)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:41)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2291)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2316)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5862)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5819)
	at org.eclipse.buildship.core.internal.workspace.BaseConfigurator.synchronizeJavaProject(BaseConfigurator.java:100)
	at org.eclipse.buildship.core.internal.workspace.BaseConfigurator.configure(BaseConfigurator.java:90)
	at org.eclipse.buildship.core.internal.workspace.BaseConfigurator.configure(BaseConfigurator.java:65)
	at org.eclipse.buildship.core.internal.extension.InternalProjectConfigurator.configure(InternalProjectConfigurator.java:64)
	at org.eclipse.buildship.core.internal.workspace.ProjectConfigurators.configureConfigurators(ProjectConfigurators.java:67)
	at org.eclipse.buildship.core.internal.workspace.SynchronizeGradleBuildOperation.synchronizeOpenWorkspaceProject(SynchronizeGradleBuildOperation.java:166)
	at org.eclipse.buildship.core.internal.workspace.SynchronizeGradleBuildOperation.synchronizeWorkspaceProject(SynchronizeGradleBuildOperation.java:140)
	at org.eclipse.buildship.core.internal.workspace.SynchronizeGradleBuildOperation.synchronizeGradleProjectWithWorkspaceProject(SynchronizeGradleBuildOperation.java:130)
	at org.eclipse.buildship.core.internal.workspace.SynchronizeGradleBuildOperation.access$000(SynchronizeGradleBuildOperation.java:45)
	at org.eclipse.buildship.core.internal.workspace.SynchronizeGradleBuildOperation$1.run(SynchronizeGradleBuildOperation.java:88)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2291)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2311)
	at org.eclipse.buildship.core.internal.workspace.SynchronizeGradleBuildOperation.synchronizeProjectsWithWorkspace(SynchronizeGradleBuildOperation.java:85)
	at org.eclipse.buildship.core.internal.workspace.SynchronizeGradleBuildOperation.run(SynchronizeGradleBuildOperation.java:67)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.runInToolingApi(DefaultGradleBuild.java:229)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager$WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:57)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2291)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2316)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:38)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.run(DefaultGradleBuild.java:191)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild.synchronize(DefaultGradleBuild.java:99)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild.synchronize(DefaultGradleBuild.java:85)
	at org.eclipse.jdt.ls.core.internal.managers.GradleBuildSupport.update(GradleBuildSupport.java:56)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager$3.runInWorkspace(ProjectsManager.java:465)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.gradle.internal.typeconversion.TypeConversionException: Cannot convert string value 'VERSION_13' to an enum value of type 'org.gradle.api.JavaVersion' (valid case insensitive values: VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_1_9, VERSION_1_10, VERSION_11, VERSION_12, VERSION_HIGHER)
	at org.gradle.internal.typeconversion.EnumFromCharSequenceNotationParser.convert(EnumFromCharSequenceNotationParser.java:38)
	at org.gradle.internal.typeconversion.EnumFromCharSequenceNotationParser.convert(EnumFromCharSequenceNotationParser.java:25)
	at org.gradle.internal.typeconversion.NotationConverterToNotationParserAdapter.parseNotation(NotationConverterToNotationParserAdapter.java:31)
	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.adaptToEnum(ProtocolToModelAdapter.java:177)
	... 46 more
Caused by: java.lang.IllegalArgumentException: Cannot convert string value 'VERSION_13' to an enum value of type 'org.gradle.api.JavaVersion' (valid case insensitive values: VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_1_9, VERSION_1_10, VERSION_11, VERSION_12, VERSION_HIGHER)
	at org.gradle.util.GUtil.toEnum(GUtil.java:485)
	at org.gradle.internal.typeconversion.EnumFromCharSequenceNotationParser.convert(EnumFromCharSequenceNotationParser.java:36)
	... 49 more
@JoseLion
Copy link

This seems to be solved on Buildship v3.1.3. For now only the snapshot version is available. Just add the update site to Eclipse configuration.
https://download.eclipse.org/buildship/updates/e413/snapshots/3.x

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

Successfully merging a pull request may close this issue.

2 participants