I've started using vim recently as my main text editor and I've tried to come up with a map command which compiles and runs my java source code.
This is what I have so far:
map <F4> :!javac % <CR>:!java %< <CR>
but it doesn't always work. For example, when The folder name is the same as the .java/.class file, I will get a 'ClassNotFound' error (which runs fine if I do it through a terminal). There are also other problems with spaces in the path name.
Does anybody have a mapping that works properly with compiling and running java source files?