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
@@ -128,26 +128,37 @@ Note: This tool is not compatible with [vim-lsp](https://github.com/prabirshrest
128
128
129
129
## Usage
130
130
131
-
The language server will provide autocomplete and other features using:
132
-
*.java files anywhere in your workspace
131
+
The language server provides autocomplete and other features using:
132
+
*Java source files anywhere in your workspace
133
133
* Java platform classes
134
-
* External dependencies specified using `pom.xml`, Bazel, or [settings](#Settings)
134
+
* External dependencies specified using `pom.xml`, Bazel, or via explicit [settings](#Settings)
135
135
136
136
## Settings
137
137
138
-
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)
138
+
Generally, the language server infers the location of the JDK and external
139
+
dependency jar files. If this process does not work correctly, you can specify
140
+
them explicitly
141
+
using [.vscode/settings.json](https://code.visualstudio.com/docs/getstarted/settings).
142
+
143
+
### Location of the JDK
144
+
145
+
The location of the JDK is determined by reading the JAVA_HOME environment
146
+
variable. If JAVA_HOME is unset, then the language server searches operating
147
+
system specific locations for a JDK. The JDK location can be explicitly set
148
+
with:
139
149
140
150
```json
141
151
{
142
-
"java.externalDependencies": [
143
-
"junit:junit:jar:4.12:test", // Maven format
144
-
"junit:junit:4.12"// Gradle-style format is also allowed
145
-
]
152
+
"java.home": "/file/path/of/the/jdk"
146
153
}
147
154
```
148
155
149
-
If all else fails, you can specify the Java class path and the locations of
150
-
source jars manually:
156
+
### External dependency jar files
157
+
158
+
By default the language server infers the Java classpath and finds source code
159
+
jars for external dependencies by running Maven or Bazel. The inference
160
+
process can be diabled by explicitly specifying classpath. Both paths may be
161
+
set explicitly with:
151
162
152
163
```json
153
164
{
@@ -160,6 +171,17 @@ source jars manually:
160
171
}
161
172
```
162
173
174
+
External dependencies can also be specified in Maven or Gradle format with:
175
+
176
+
```json
177
+
{
178
+
"java.externalDependencies": [
179
+
"junit:junit:jar:4.12:test", // Maven format
180
+
"junit:junit:4.12"// Gradle-style format is also allowed
181
+
]
182
+
}
183
+
```
184
+
163
185
You can generate a list of external dependencies using your build tool:
0 commit comments