Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This only can complete or import class from JDK?how can i add my classes; #40

Closed
wsdjeg opened this issue Aug 3, 2015 · 14 comments
Closed

Comments

@wsdjeg
Copy link
Contributor

wsdjeg commented Aug 3, 2015

here is my .vimrc.
Plugin 'artur-shaik/vim-javacomplete2'
autocmd FileType java set omnifunc=javacomplete#Complete
nmap :call javacomplete#AddImport()
imap :call javacomplete#AddImport()
""let g:JavaComplete_SourcesPath='/home/wsdjeg/wsdjeg.github.io/code'
""let g:JavaComplete_LibsPath='/home/wsdjeg/wsdjeg.github.io/code'
here is my file:
/home/wsdjeg/wsdjeg.github.io/code/src/com/wsdjeg/day01/Person.java(package com.wsdjeg.day01;)
/home/wsdjeg/wsdjeg.github.io/code/bin/com/wsdjeg/day01/Person.class
if i writer a new file named Man.java(home/wsdjeg/wsdjeg.github.io/code/bin/com/wsdjeg/day01/Man.java)
in the new file how can complete the Person's method

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 3, 2015

how can i add /home/wsdjeg/wsdjeg.gitgub.com/code/bin into the classpath
and how can i add home/wsdjeg/wsdjeg.gitgub.com/code/lib into the classpath

@artur-shaik
Copy link
Owner

Can you say, what is your working directory. What you get if you run :!pwd from vim?

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 3, 2015

cd ~/wsdjeg.github.io/code
vim src/com/wsdjeg/day01/Person.java
after edite :wq
then javac -d ./bin src/com/wsdjeg/day01/Person
then java -cp ./bin com.wsdjeg.day01.Person

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 3, 2015

all my code is in my github/wsdjeg.github.io

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 4, 2015

the same issus
vgod/vimrc#3

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 4, 2015

the :!pwd show the path to my java fies
such as /home/wsdjeg/wsdjeg.github.io/code/src/com/wsdjeg/day21

@artur-shaik
Copy link
Owner

Looks like this link refer to old version of javacomplete.

In your example you have commented JavaComplete_SourcesPath, does it commented in your vimrc? If you want have completion of your code, you need to specify this parameter. Or run vim from your wsdjeg.github.io directory, src dir will append automatically.

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 6, 2015

i have run vim from wsdjeg.github.io
use these command
cd /home/wsdjeg/wsdjeg.github.io
then vim code/src/com/wsdjeg/day01/person.java
but in the vim when i input :!pwd,it also return
/home/wsdjeg/wsdjeg.github.io/code/src/com/wsdjeg/day01

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 6, 2015

can the process java close auto,when i close the vim .the java process need 600~900M cpu .and many time not only one java

@artur-shaik
Copy link
Owner

artur-shaik commented Aug 6, 2015 via email

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 6, 2015

i have not set g:JavaComplete_SourcesPath and g:JavaComplete_lib .but i have set the~/.bashrc:CLASSPTH=.:${Javahome}/lib:${jrehome}/lib:home/wsdjeg/wsdjeg.github.io/lib
so it can import all the classes inthis lib ,but how can i complete cle >>> class damoclass extends List like the damo.gif in you README.MD

@artur-shaik
Copy link
Owner

Please, try to use g:JavaComplete_SourcesPath or g:JavaComplete_LibsPath, and you should be able to complete your classes.
And CLASSPTH is wrong.

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 7, 2015

i will try tonight ,thank you !

@wsdjeg
Copy link
Contributor Author

wsdjeg commented Aug 7, 2015

thank you i have got it!

@wsdjeg wsdjeg closed this as completed Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants