last day (14 days later) » 

3:44 PM
1
A: How do I specify an old JDK compliance in an Eclipse project?

eugenioyThe project is probably configured to use JDK 1.4. Since you don't have that one installed, you need to remove it and add the 1.8 you actually have. Right click the project and select "Build Path" -> "Configure Build Path" In the "Java Build Path" option, remove the "JRE 1.4" Go to "Libraries"...

 
Not working. I am getting this message and the warning: imageshack.com/a/img911/3602/8mOsOd.png
Somehow Eclipse doesn't think that JDK 8 is compatible with 1.4.
 
What part is not working. Were you able to remove JRE 1.4 and add the JRE 1.8? And do you get a new error message now? If so, which one?
 
I can remove the old JRE and add the new one but I am still getting the warning.
I can also specify that 1.4 is compatible in the execution environment pane but I still get the warning.
Ah actually I am now getting this warning: > The JRE container on the classpath is not a perfect match to the 'J2SE-1.4' execution environment
Moreover, I am allowed to write Java 8 code in the project.
 
So now you only have the JRE 1.8 in the "Libraries" section of the build path, right? And if you click on that one and hit "Edit" what "Execution environment" do you have selected? As for disallowing newer code, did you follow the second part of my answer?
 
> So now you only have the JRE 1.8 in the "Libraries" section of the build path, right? Correct. > And if you click on that one and hit "Edit" what "Execution environment" do you have selected? I have specified that 1.4 is compatible with 1.8. > As for disallowing newer code, did you follow the second part of my answer? Yes.
I have the project on GitHub.
 
3:44 PM
In the "Libraries" section, select the JRE 1.8 and hit "Edit", then select "JavaSE-1.8" in the "Execution Environment".
 
Now getting "'The JRE container on the classpath is not a perfect match to the 'J2SE-1.4'"
Hm. I did a quick fix and now all warnings are gone.
Scratch that
 
So did it finally work?
 
Nah. I am getting this in the preference pane.
I think my execution environment should be 1.8 right?
 
Do you see this in the JRE properties?
 
3:55 PM
And make sure to clean and rebuild after each change
 
Yeah
I think I see the problem
In my MANIFEST.mf
Bundle-RequiredExecutionEnvironment: J2SE-1.4
I don't think that's correct.
You can run the plugin on 1.8, no problem.
If I change it to J2SE-1.8 the problem goes away
(the warning that is)
 
great :)
 
Yeah everything works the way I want it to now but is that correct to say that the minimum execution environment for my plugin is 1.8?
I am not using any 1.8 features but certainly I am testing it with 1.8.
But, I am able to use Java 8 libraries. Hm.
Interesting problem. Thanks for the help btw.
 
no problem
 

last day (14 days later) »