You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-10Lines changed: 32 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,26 +125,37 @@ Note: This tool is not compatible with [vim-lsp](https://github.com/prabirshrest
125
125
126
126
## Usage
127
127
128
-
The language server will provide autocomplete and other features using:
129
-
*.java files anywhere in your workspace
128
+
The language server provides autocomplete and other features using:
129
+
*Java source files anywhere in your workspace
130
130
* Java platform classes
131
-
* External dependencies specified using `pom.xml`, Bazel, or [settings](#Settings)
131
+
* External dependencies specified using `pom.xml`, Bazel, or via explicit [settings](#Settings)
132
132
133
133
## Settings
134
134
135
-
If the language server doesn't detect your external dependencies automatically, you can specify them using [.vscode/settings.json](https://code.visualstudio.com/docs/getstarted/settings)
135
+
Generally, the language server infers the location of the JDK and external
136
+
dependency jar files. If this process does not work correctly, you can specify
137
+
them explicitly
138
+
using [.vscode/settings.json](https://code.visualstudio.com/docs/getstarted/settings).
139
+
140
+
### Location of the JDK
141
+
142
+
The location of the JDK is determined by reading the JAVA_HOME environment
143
+
variable. If JAVA_HOME is unset, then the language server searches operating
144
+
system specific locations for a JDK. The JDK location can be explicitly set
145
+
with:
136
146
137
147
```json
138
148
{
139
-
"java.externalDependencies": [
140
-
"junit:junit:jar:4.12:test", // Maven format
141
-
"junit:junit:4.12"// Gradle-style format is also allowed
142
-
]
149
+
"java.home": "/file/path/of/the/jdk"
143
150
}
144
151
```
145
152
146
-
If all else fails, you can specify the Java class path and the locations of
147
-
source jars manually:
153
+
### External dependency jar files
154
+
155
+
By default the language server infers the Java classpath and finds source code
156
+
jars for external dependencies by running Maven or Bazel. The inference
157
+
process can be diabled by explicitly specifying classpath. Both paths may be
158
+
set explicitly with:
148
159
149
160
```json
150
161
{
@@ -157,6 +168,17 @@ source jars manually:
157
168
}
158
169
```
159
170
171
+
External dependencies can also be specified in Maven or Gradle format with:
172
+
173
+
```json
174
+
{
175
+
"java.externalDependencies": [
176
+
"junit:junit:jar:4.12:test", // Maven format
177
+
"junit:junit:4.12"// Gradle-style format is also allowed
178
+
]
179
+
}
180
+
```
181
+
160
182
You can generate a list of external dependencies using your build tool:
0 commit comments