All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 ===============================================================================
2 ALE Java Integration *ale-java-options*
5 ===============================================================================
6 checkstyle *ale-java-checkstyle*
8 *ale-options.java_checkstyle_config*
9 *g:ale_java_checkstyle_config*
10 *b:ale_java_checkstyle_config*
11 java_checkstyle_config
12 g:ale_java_checkstyle_config
14 Default: `'/google_checks.xml'`
16 A path to a checkstyle configuration file.
18 If a configuration file is specified with |g:ale_java_checkstyle_options|,
19 it will be preferred over this setting.
21 The path to the configuration file can be an absolute path or a relative
22 path. ALE will search for the relative path in parent directories.
24 *ale-options.java_checkstyle_executable*
25 *g:ale_java_checkstyle_executable*
26 *b:ale_java_checkstyle_executable*
27 java_checkstyle_executable
28 g:ale_java_checkstyle_executable
30 Default: `'checkstyle'`
32 This variable can be changed to modify the executable used for checkstyle.
34 *ale-options.java_checkstyle_options*
35 *g:ale_java_checkstyle_options*
36 *b:ale_java_checkstyle_options*
37 java_checkstyle_options
38 g:ale_java_checkstyle_options
42 This variable can be changed to modify flags given to checkstyle.
44 If a configuration file is specified with `-c`, it will be used instead of
45 configuration files set with |g:ale_java_checkstyle_config|.
48 ===============================================================================
49 clang-format *ale-java-clangformat*
51 See |ale-c-clangformat| for information about the available options.
52 Note that the C options are also used for Java.
55 ===============================================================================
56 cspell *ale-java-cspell*
58 See |ale-cspell-options|
61 ===============================================================================
62 javac *ale-java-javac*
64 *ale-options.java_javac_classpath*
65 *g:ale_java_javac_classpath*
66 *b:ale_java_javac_classpath*
68 g:ale_java_javac_classpath
69 Type: |String| or |List|
72 This variable can be set to change the global classpath for Java.
74 *ale-options.java_javac_executable*
75 *g:ale_java_javac_executable*
76 *b:ale_java_javac_executable*
78 g:ale_java_javac_executable
82 This variable can be set to change the executable path used for javac.
84 *ale-options.java_javac_options*
85 *g:ale_java_javac_options*
86 *b:ale_java_javac_options*
88 g:ale_java_javac_options
92 This variable can be set to pass additional options to javac.
94 *ale-options.java_javac_sourcepath*
95 *g:ale_java_javac_sourcepath*
96 *b:ale_java_javac_sourcepath*
98 g:ale_java_javac_sourcepath
99 Type: |String| or |List|
102 This variable can set multiple source code paths, the source code path is a
103 relative path (relative to the project root directory).
105 The source path can be set as a String with a system-dependent path
106 separator. Note that the Unix path separator is a colon (`:`), and on
107 Windows the path separator is a semicolon (`;`). >
109 let g:ale_java_javac_sourcepath = 'build/gen/source/xx/main:build/gen/source'
111 The source path can be set as a List so ALE will add the appropriate path
112 separator for the host system automatically. >
114 let g:ale_java_javac_sourcepath = [
115 \ 'build/generated/source/querydsl/main',
116 \ 'target/generated-sources/source/querydsl/main',
120 ===============================================================================
121 google-java-format *ale-java-google-java-format*
123 *ale-options.java_google_java_format_executable*
124 *g:ale_java_google_java_format_executable*
125 *b:ale_java_google_java_format_executable*
126 java_google_java_format_executable
127 g:ale_java_google_java_format_executable
129 Default: `'google-java-format'`
131 See |ale-integrations-local-executables|
133 *ale-options.java_google_java_format_options*
134 *g:ale_java_google_java_format_options*
135 *b:ale_java_google_java_format_options*
136 java_google_java_format_options
137 g:ale_java_google_java_format_options
141 This variable can be set to pass additional options
144 ===============================================================================
147 *ale-options.java_pmd_options*
148 *g:ale_java_pmd_options*
149 *b:ale_java_pmd_options*
151 g:ale_java_pmd_options
153 Default: `'-R category/java/bestpractices'`
155 This variable can be changed to modify flags given to PMD. Do not specify -f
156 and -d. They are added automatically.
159 ===============================================================================
160 javalsp *ale-java-javalsp*
162 To enable Java LSP linter you need to download and build the vscode-javac
163 language server from https://github.com/georgewfraser/java-language-server.
165 Before building the language server you need to install pre-requisites: npm,
166 maven, and protobuf. You also need to have Java 13 and JAVA_HOME properly
169 After downloading the source code and installing all pre-requisites you can
170 build the language server with the included build.sh script:
174 This will create launch scripts for Linux, Mac, and Windows in the dist folder
177 - `lang_server_linux.sh`
178 - `lang_server_mac.sh`
179 - `lang_server_windows.sh`
181 To let ALE use this language server you need to set the executable, as
184 *ale-options.java_javalsp_executable*
185 *g:ale_java_javalsp_executable*
186 *b:ale_java_javalsp_executable*
187 java_javalsp_executable
188 g:ale_java_javalsp_executable
192 This variable must be set to the absolute path of the language server
193 launcher executable. For example: >
195 let g:ale_java_javalsp_executable = '/java-language-server/dist/lang_server_linux.sh'
197 *ale-options.java_javalsp_config*
198 *g:ale_java_javalsp_config*
199 *b:ale_java_javalsp_config*
201 g:ale_java_javalsp_config
205 The javalsp linter automatically detects external dependencies for Maven and
206 Gradle projects. In case the javalsp fails to detect some of them, you can
207 specify them configuring settings for the language server, such as in your
210 let b:ale_java_javalsp_config = {
212 \ 'externalDependencies': [
213 \ 'junit:junit:jar:4.12:test',
217 \ 'lib/some-dependency.jar',
218 \ '/android-sdk/platforms/android-28.jar',
225 require("ale").setup.buffer({
228 externalDependencies = {
229 "junit:junit:jar:4.12:test",
233 "lib/some-dependency.jar",
234 "/android-sdk/platforms/android-28.jar",
240 The Java language server will look for the dependencies you specify in
241 `externalDependencies` array in your Maven and Gradle caches ~/.m2 and
245 ===============================================================================
246 eclipselsp *ale-java-eclipselsp*
248 To enable Eclipse JDT LSP linter you need to clone and build the eclipse.jdt.ls
249 language server from https://github.com/eclipse/eclipse.jdt.ls. Simply
250 clone the source code repo and then build the plugin:
252 `./mvnw clean verify`
254 Note: currently, the build can only run when launched with JDK 11. More
255 recent versions can be used to run the server though.
257 After build completes the files required to run the language server will be
258 located inside the repository folder `eclipse.jdt.ls`. Please ensure to set
259 |g:ale_java_eclipselsp_path| to the absolute path of that folder.
261 You could customize compiler options and code assists of the server.
262 Under your project folder, modify the file `.settings/org.eclipse.jdt.core.prefs`
263 with options presented at
264 https://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/JavaCore.html.
266 *ale-options.java_eclipselsp_path*
267 *g:ale_java_eclipselsp_path*
268 *b:ale_java_eclipselsp_path*
270 g:ale_java_eclipselsp_path
272 Default: `'$HOME/eclipse.jdt.ls'`
274 Absolute path to the location of the eclipse.jdt.ls repository folder. Or if
275 you have VSCode extension installed the absolute path to the VSCode
276 extensions folder (e.g. $HOME/.vscode/extensions/redhat.java-0.4x.0 in
279 *ale-options.java_eclipselsp_executable*
280 *g:ale_java_eclipselsp_executable*
281 *b:ale_java_eclipse_executable*
282 java_eclipselsp_executable
283 g:ale_java_eclipselsp_executable
287 This variable can be set to change the executable path used for java.
289 *ale-options.java_eclipselsp_config_path*
290 *g:ale_java_eclipselsp_config_path*
291 *b:ale_java_eclipse_config_path*
292 java_eclipselsp_config_path
293 g:ale_java_eclipselsp_config_path
297 Set this variable to change the configuration directory path used by
298 eclipselsp (e.g. `$HOME/.jdtls` in Linux). By default ALE will attempt to
299 use the configuration within the installation directory.
301 This setting is particularly useful when eclipselsp is installed in a
302 non-writable directory like `/usr/share/java/jdtls`, as is the case when
303 installed via system package.
305 *ale-options.java_eclipselsp_workspace_path*
306 *g:ale_java_eclipselsp_workspace_path*
307 *b:ale_java_eclipselsp_workspace_path*
308 java_eclipselsp_workspace_path
309 g:ale_java_eclipselsp_workspace_path
313 If you have Eclipse installed it is a good idea to set this variable to the
314 absolute path of the Eclipse workspace. If not set this value will be set to
315 the parent folder of the project root.
317 *ale-options.java_eclipselsp_javaagent*
318 *g:ale_java_eclipselsp_javaagent*
319 *b:ale_java_eclipselsp_javaagent*
320 java_eclipselsp_javaagent
321 g:ale_java_eclipselsp_javaagent
325 A variable to add java agent for annotation processing such as Lombok.
326 If you have multiple java agent files, use space to separate them.
329 let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar'
332 ===============================================================================
333 uncrustify *ale-java-uncrustify*
335 See |ale-c-uncrustify| for information about the available options.
338 ===============================================================================
339 vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: