Java – compile to a specific JRE using eclipse

I have two questions about compiling projects into specific jres in Eclipse:

1) Project Properties Window > java build path > Library tab:

If I want to compile to JRE 6 – should the window display JRE 6 and JRE 7 included in the build path? Or is JRE 6 enough?

My current situation – good or bad?

2) I know the steps to compile a project into a specific JRE:

A - make sure that the JRE is in the installed JRE list in eclipse

B - click "add library" in the window I display to add it to the construction path of the project

C - set the compiler compliance level of the project to be the same as the oldest JRE I want my application to run (JRE I added to the build path)

All this is good, but I still don't understand one thing: what is the difference between JRE in Java build path and JRE version as compiler compliance level?

Solution

Compiler compliance level is the language level you choose from the available language levels set for your project

The build path is used to create a Java class path

In the build classpath, it is a collection of paths visible or available to the compiler when building the project

The configure build path dialog box is used to work with projects named classpath. Which files are usually hidden

Then the compliance level of the project you selected will be used for specific compliance level execution

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>