Đây là một bản tóm tắt các phương pháp khác nhau mà làm việc cho tôi trong vim7.4 linux và Syntastic3.7.0-224 với tín dụng mỗi.
Phương pháp 1 - thủ công tạo ra các .syntastic_javac_config
1. Edit .vimrc and use this syntax:
let g:syntastic_java_javac_config_file_enabled = 1
2. Where you edit your vim files, add this to a file named .syntastic_javac_config
let g:syntastic_java_javac_classpath = '/home/davis/progs/princeton-algos/week1/libs/algs4.jar'
Phương pháp 2 - lợi thế dù bạn ở đâu chỉnh sửa đường dẫn lớp được biết đến.
1. Edit .vimrc and use this syntax:
let g:syntastic_java_javac_classpath = "/home/davis/progs/princeton-algos/week1/libs/algs4.jar"
này thêm jar và
Phương pháp 3 - thế hệ tự động của tập tin .syntastic_javac_config
1. Edit .vimrc and use this syntax:
let g:syntastic_java_javac_config_file_enabled = 1
2. Edit a java file with vim
3. :SyntasticJavacEditClasspath
When the edit window opens, add the class path without quotes and a newline after each entry the class path. In my case, this is the entry
for the setting includes the current folder as well:
/home/davis/progs/princeton-algos/week1/libs/algs4.jar
.
4 :wq the edit setting window
5. Now the class path is set for syntastic when editing files from that location. If you edit from a new directory, you will need to repeat the process.
Bên cạnh những ý kiến trên, post này cũng giúp.
Nguyên tắc chỉ hoạt động như một người trung gian giữa Vim và nhiều chương trình bên ngoài. Bạn nên 1. tìm ra chương trình nào được sử dụng để kiểm tra mã của bạn, 2. xem tài liệu của nó để biết cách làm cho nó thông minh hơn, 3. xem bạn có thể cấu hình Syntastic hay không. – romainl
Rất có thể javac đang bị nhầm lẫn vì bạn đang chạy nó từ thư mục sai. – FDinoff
Cảm ơn bạn. Tôi đang sử dụng nó kết hợp với You Complete Me (YCM). – lorean