Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Famous "There are no JREs installed in the workspace". Can it do any harm?

Tags:

java

eclipse

I'm using java 1.8 with lots of pleasure.

One of my projects in my workspace needs to compile and be compatible with java 1.6, so i changed the appropriate eclipse options.

Now i get the famous message:

Build path specifies execution environment JavaSE-1.6. There are no JREs 
installed in the workspace that are strictly compatible with this environment.

There are many questions and answers on how to solve this problem. So no problem there.

But what are theoretically the problems that may come up when this warning is ignored? (everything seem to be running nicely on 1.6)

like image 492
Tinus Tate Avatar asked Dec 19 '25 12:12

Tinus Tate


1 Answers

One potential problem is that your 1.6-targeted code may accidentally use a class or interface that is introduced in JDK1.8. If the JRE that is associated with a 1.6 target in your workspace is actually a JRE1.8 or 1.7, the code may compile fine but you may end up with something like NoClassDefFoundError at runtime.

like image 121
M A Avatar answered Dec 21 '25 00:12

M A



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!