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

how to use IgnoreUnnamedModuleForSplitPackage #3074

Closed
huige007 opened this issue Feb 26, 2024 · 3 comments
Closed

how to use IgnoreUnnamedModuleForSplitPackage #3074

huige007 opened this issue Feb 26, 2024 · 3 comments
Labels

Comments

@huige007
Copy link

As described in title, how can i enable feature IgnoreUnnamedModuleForSplitPackage. Because I got following error msg in vscode-java(redhat.java)
The package java.util.concurrent is accessible from more than one module: , java.base

after I set the java.jdt.ls.java.home to jdk8, above error msg disappeared

@rgrunber
Copy link
Contributor

rgrunber commented Feb 28, 2024

@snjeza pointed out we set the option by default at

javaCoreOptions.put(JavaCore.COMPILER_IGNORE_UNNAMED_MODULE_FOR_SPLIT_PACKAGE, JavaCore.ENABLED);
. What version of vscode-java are you using ? This would have been the default since vscode-java 1.12.0.

You should also be able to set this option using java.settings.url. See https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Language-Server-Settings-&-Capabilities#java-compiler-options.

.vscode/settings.json

{
	"java.settings.url": ".vscode/settings.prefs"
}

.vscode/settings.prefs

org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage=enabled

@rgrunber
Copy link
Contributor

I think we can close this in favour of redhat-developer/vscode-java#3505 since there's some more information there.

@huige007
Copy link
Author

huige007 commented Feb 29, 2024

I am using the Language Support for Java(TM) by Red Hat (version: v1.28.1) in vscode
I also add java.settings.url and org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage=enabled, but I still get the same error msg, is there any way that I can confirm that the options is working?

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

No branches or pull requests

2 participants