diff --git a/syntax_checkers/java/javac.vim b/syntax_checkers/java/javac.vim index a81801c5..da6e4a9c 100644 --- a/syntax_checkers/java/javac.vim +++ b/syntax_checkers/java/javac.vim @@ -129,7 +129,14 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1 " load custom classpath {{{2 if g:syntastic_java_javac_custom_classpath_command !=# '' - let lines = syntastic#util#system(g:syntastic_java_javac_custom_classpath_command) + " Pre-process the classpath command string a little. + let classpath_command = g:syntastic_java_javac_custom_classpath_command + for sub in [['%FILE_PATH%', expand('%:p')], + \ ['%FILE_NAME%', expand('%:t')], + \ ['%FILE_DIR%', expand('%:p:h')]] + let classpath_command = substitute(classpath_command, sub[0], sub[1], 'g') + endfor + let lines = system(classpath_command) if syntastic#util#isRunningWindows() || has('win32unix') let lines = substitute(lines, "\r\n", "\n", 'g') endif