Reputation: 454
I'm trying to program a game using lwjgl library and I'm using vim as my editor. I would like to have syntax cheking so I use syntastic.
The javac checker page explains how to add the classpath to the javac checker using SyntasticJavacEditClasspath command.
My problem is that I put there the path to lwjgl.jar and lwjgl_utils.jar and it's still founding a lot of missing library errors.
I put this on the opened buffer:
/home/ionthas/development/java/Jump2Box/lib/jars/lwjgl.jar
I think I'm inserting the classpath in the wrong way.
Here is one of the 17 errors that show up: (The code runs perfectly)
src/com/ionsoft/engine/Engine.java|1 col 17 error|
package org.lwjgl does not exist import org.lwjgl.LWJGLException;
Here it is my configuration in .vimrc
18 " Syntastic
19 highlight SyntasticErrorSign guifg=white guibg=red
20 highlight SyntasticErrorLine guibg=red
21 let g:syntastic_check_on_open = 1
22 let g:syntastic_enable_signs = 0
23 let g:syntastic_enable_ballons = 0
24 let g:syntastic_quiet_warnings = 1
25 let g:syntastic_auto_loc_list = 1
26 let g:syntastic_java_checkers = ['checkstyle', 'javac']
27 let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
28 let g:syntastic_mode_map = { 'mode': 'active',
29 \ 'active_filetypes': ['ruby', 'java'],
30 \ 'passive_filetypes': [''] }
31 let g:syntastic_java_javac_classpath = '~/home/ionthas/development/java/Jump2Box/lib/jars/lwjgl.jar'
Anyone can help me?
Upvotes: 3
Views: 2634
Reputation: 1030
If you use gradle to manage your project you can use the following plugin to automatically manage you classpath. Every time you add/update dependencies it will update a local class path file.
https://github.com/Scuilion/gradle-syntastic-plugin
Upvotes: 3
Reputation: 98
Tilde ~
is your home directory. In your case, probably /home/ionthas/
.
So your classpath:
~/home/ionthas/development/java/Jump2Box/lib/jars/lwjgl.jar
Would actually expand to:
/home/ionthas/home/ionthas/development/java/Jump2Box/lib/jars/lwjgl.jar
An extra home directory, hence the error.
Taking out the tilde ~
would probably do the trick.
Upvotes: 2
Reputation: 454
I solved the problem using the relative path
./lib/jars/lwjgl.jar
insted of the absolute path
/home/ionthas/development/java/Jump2Box/lib/jars/lwjgl.jar
Upvotes: 0