-
Notifications
You must be signed in to change notification settings - Fork 456
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
Access restriction error in Java language server log #1188
Comments
Can you please attach a sample project? |
@fbricon I afraid I cannot attach the problematic project here directly as it is not open source. I will try creating a dummy project with those library dependencies and see if I can re-produce the problem there. |
@fbricon I realized that there are actually some exceptions in the Java language server log file, not sure if that matters:
|
is there any solution to this? or what is "the right way" to solve the original problem? |
@lfarkas you can try to call the 'Java: Clean the Java language server workspace' command. |
thanks it's working! |
There are two issues:
|
some info as follow: !ENTRY org.eclipse.jdt.ls.core 4 0 2022-06-24 00:40:59.039 !ENTRY org.eclipse.jdt.ls.core 1 0 2022-06-24 00:41:01.712 |
@ai-chen2050 could you try the following patch: index 713e0a213..fab67d82c 100644
--- a/common/build.gradle
+++ b/common/build.gradle
@@ -1,6 +1,8 @@
+import org.gradle.plugins.ide.eclipse.model.AccessRule
plugins {
id 'java'
}
+apply plugin: 'eclipse'
version '1.0.0'
@@ -68,3 +70,15 @@ jacocoTestReport {
}
}
}
+
+eclipse {
+ classpath {
+ file {
+ whenMerged {
+ def jre = entries.find { it.path.contains 'org.eclipse.jdt.launching.JRE_CONTAINER' }
+ jre.accessRules.add(new AccessRule('accessible', 'sun/misc/**'))
+ jre.accessRules.add(new AccessRule('accessible', 'com/sun/**'))
+ }
+ }
+ }
+}
diff --git a/framework/build.gradle b/framework/build.gradle
index e656c73b0..021f2fe28 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -1,9 +1,11 @@
+import org.gradle.plugins.ide.eclipse.model.AccessRule
plugins {
id "org.sonarqube" version "2.6"
}
apply plugin: 'application'
apply plugin: 'checkstyle'
+apply plugin: 'eclipse'
mainClassName = 'org.tron.program.FullNode'
@@ -281,3 +283,15 @@ task copyToParent(type: Copy) {
}
build.finalizedBy(copyToParent)
+
+eclipse {
+ classpath {
+ file {
+ whenMerged {
+ def jre = entries.find { it.path.contains 'org.eclipse.jdt.launching.JRE_CONTAINER' }
+ jre.accessRules.add(new AccessRule('accessible', 'sun/misc/**'))
+ jre.accessRules.add(new AccessRule('accessible', 'com/sun/**'))
+ }
+ }
+ }
+} |
is need compiled by myself? And install offline, right ? |
|
Please check #219 (comment) for solution. |
Hi,
I have recently started using VSCode with your extension for a Gradle project, however I come across the "Access restriction" error which was flagged in other issues (#120 and #219). I have tried the proposed solution in those threads but without any luck so far.
Below are few errors that I got:
And they are primarily from the below library import:
I have integrated below access rule into my build.gradle:
And the generated .classpath is as follows:
It looks to me that the .classpath is ok, but somehow I am still getting the same error. The option to clean the Java language server workspace does not seem to help either. Appreciate if you can shed some lights on this.
The text was updated successfully, but these errors were encountered: