Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

(v3.7.0) Java: javac

LCD 47 edited this page Oct 6, 2015 · 1 revision

Maintainers:

Commands

The following commands are available:

SyntasticJavacEditClasspath
This opens a new window where you can specify a classpath. Individual paths may be specified one per line, or separated by colons : on UNIX, or by semicolons ; on Windows.
SyntasticJavacEditConfig
This command is only relevant if g:syntastic_java_javac_config_file_enabled is set. It opens a buffer where you can specify project-specific options from the list below. These options will be saved in a file pointed to by g:syntastic_java_javac_config_file (.syntastic_javac_config by default). The settings have to be specified in VimL language.

Checker options

g:syntastic_java_javac_executable (Default: 'javac')
Java compiler executable used for checking file
g:syntastic_java_maven_executable (Default: 'mvn')
Maven executable used for loading maven project classpath
g:syntastic_java_javac_options (Default: '-Xlint')
javac options
g:syntastic_java_javac_classpath (Default: '')
javac classpath; it can be changed by running the SyntasticJavacEditClasspath command
g:syntastic_java_javac_delete_output (Default: 1)
if set, the checker will delete the .class file created by javac
g:syntastic_java_javac_autoload_maven_classpath (Default: 1)
if enabled, and a file pom.xml is found in the current working directory, maven is used to load Maven project's classpath
g:syntastic_java_javac_config_file_enabled (Default: 0)
if enabled, a file .syntastic_javac_config containing the classpath is created in the current working directory; you can edit this file using the SyntasticJavacEditClasspath command; the change will take effect next time you run the checker in the current directory
g:syntastic_java_javac_config_file (Default: '.syntastic_javac_config')
name of the configuration file used by javac (you probably don't need to change this)
g:syntastic_java_javac_custom_classpath_command (Default: '')
when specified will execute a custom command to get a classpath; the command classpath output can be in traditional Java form, or specified on separate lines; `%FILE_PATH%`, `%FILE_NAME%`, and `%FILE_DIR%` are expanded to the current file's full path, filename, and base directory respectively, all of them escaped for use in a shell command.

Using Ant

When using ant, you can have a custom build target (named for example 'path') that will output your project's classpath. You can then use :SyntasticJavacEditConfig and add the following line to use it with javac checker:

let g:syntastic_java_javac_custom_classpath_command =
    \ "ant -q path | grep echo | cut -f2- -d] | tr -d ' ' | tr ':' '\n'"

Using Gradle

With Gradle projects where the default java plugin is used, you can apply gradle-syntastic-plugin. This will output the classpath to a .syntastic_javac_config file.

Clone this wiki locally