I see where the error is occurring in the code and I can add a simple
check, but I want to make sure I'm not just masking an issue that
should be handled another way. Can you send me your .classpath file
and the contents of your TestApp.java file (perhaps stripped down to
the bare minimum where the issue is still reproducible)? Or if you
can provide a full sample project for which this issue is
reproducible, that would be event better.
--
eric
My classpath looks like:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con"
path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>
And it happens with an empty .java file.
My project is an existing project that I started developing using just
vim and then imported as an eclipse android project when someone told
me about eclim. It's not in my workspace directory. Automatic import
functions work..
Thanks,
Aaron
I couldn't reproduce the issue, but I went ahead and added the null
check anyways. If you build eclim from the latest git master you
shouldn't receive that error anymore. However, I have a feeling that
the root cause of the issue is that your .classpath file is missing
the JRE_CONTAINER entry:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
If you add that your .classpath that may solve the issue without the
need for my code fix.
--
eric
Thank you for reporting this. I'll take a closer look when I get a
chance.
--
eric
I finally got a chance to test this out and I was able to reproduce
the issue with a newly created android project. However, I was able
to resolve the issue by simply adding the missing JRE_CONTAINER entry
to my project's .classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>
After saving the .classpath in vim (forcing eclim to reload it inside
of eclipse), I was able to search for jdk classes. Note, I did get an
error marker on the android con entry when saving the .classpath file,
but the changes were still applied.
Before:
$ eclim -command java_docsearch -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
<no results>
$ eclim -command java_search -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
jar:file:///usr/local/java/android-sdk-linux/platforms/android-2.0/android.jar!java/lang/String.class|1 col 1|java.lang.String
After adding the missing entry:
$ eclim -command java_docsearch -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
http://java.sun.com/javase/6/docs/api/com/sun/org/apache/xpath/internal/operations/String.html
http://java.sun.com/javase/6/docs/api/java/lang/String.html
$ eclim -command java_search -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
zip:///opt/java/src.zip!/com/sun/org/apache/xpath/internal/operations/String.java|27 col 14|com.sun.org.apache.xpath.internal.operations.String
zip:///opt/java/src.zip!/java/lang/String.java|92 col 20|java.lang.String
jar:file:///usr/local/java/android-sdk-linux/platforms/android-2.0/android.jar!java/lang/String.class|1 col 1|java.lang.String
--
eric