Shared publicly  - 
1
Johannes Dorn's profile photoVeselin Raychev's profile photoCode Recommenders's profile photo
11 comments
 
Several different eclipses. Even a clean install of Eclipse Kepler, I consistently get that it cannot install:

Only one of the following can be installed at once: 
    Code Recommenders: Injection Runtime 2.0.0.v20131016-0745 (org.eclipse.recommenders.injection 2.0.0.v20131016-0745)
    Code Recommenders: Injection Runtime 1.0.5.v20130822-0858-b90 (org.eclipse.recommenders.injection 1.0.5.v20130822-0858-b90)
    Code Recommenders: Injection Runtime 1.0.4.v20130612-1006-b77 (org.eclipse.recommenders.injection 1.0.4.v20130612-1006-b77)
 
Great thanks. However even after install, there are no models that suggest anything. Even for basic classes like File. Is there a model for android?
 
Hi Veselin,
I'm sorry to hear that CR is giving you trouble.
Let's cover the basics first, just to rule out even basic things:
1. Make sure you have an internet connection, as the models have to be downloaded from our servers.
2. Goto the Eclipse preferences->Code Recommenders->Models Please make sure, that the standard model repository is on top: http://download.eclipse.org/recommenders/models/luna-m3
3. Still in the preferences, go  to Java/Editor/Content Assist/Advanced and make sure that Intelligent Java Proposals (Recommenders) is active, either in default proposals or available for cycling
4. If you still don't have any recommendations, Open the Models Coordinates View (Show View/Other/Recommenders/Model Coordinates View), There you should see the aforementioned repository URL along with 2564 known coordinates. Find the entry for jre:jre:1.0 
Are there blue circles, red crosses or green check marks? In the first case, right click and select download models.
5. Open the Project Coordinates View (Show View/Others/Recommenders/... , This can take a while). Is there a "Location" entry called something like JavaSE-1.7 and a coordinate of jre:jre:1.7.0

Unfortunately, there are no Android models as of this time.
 
OK. Thanks a lot for the pointer. I have seen this jre now and enabled it.
 
Your welcome! I take it you now get recommendations?

Since we are in the process of improving our documentation i would like to know what exactly you did when "enabling the jre". I am not sure what that means. Any pointers to let us know how to address issues such as yours in the future would be most welcome.
 
It still does not give me recommendations. But I did not find the jre in the huge lists of models. I try simple things. IS this supposed to give suggestions?

void test() throws IOException, FileNotFoundException {
FileInputStream s = new FileInputStream(new File(""));
try {

} finally {
s.
}
}

 
Hi again,
the jre should be the first entry in the Model Coordinates view.

That code snippet should give you recommendations. Since the models have to be downloaded first, it may take a while until our recommendations can be displayed, though. 

Do you get no recommendations at all or just the usual alphabetical list?

Go to the Eclipse Preferences -> Code Recommenders -> Completions
Make sure that "Call Completion Processor" is checked.
Also make sure that "Enable Intelligent code completion" is checked.
 
OK. Thanks. Maybe I wasn't clear. I downloaded the jre package, but there were still no completions.

It turns out, if I am in an android Java project, code recommenders never give any completions. In a regular Java project, I get completions.

Anyway, thanks. Now I know when it works.
 
The issue with JRE types in Android projects is that Android packages JRE types within its android.jar, which right now is not identified as a JRE artifact. We are working on getting this identification working.
Luckily, there is a fairly easy workaround: to enable code completion for JRE types like FileInputStream in Android projects, you can open the Project Coordinate View, find the location entry "android.jar" and enter a coordinate of "jre:jre:1.6.0".
Add a comment...