Changing Java Version From Within Eclipse

后端 未结 3 864
忘掉有多难
忘掉有多难 2020-12-01 18:30

I wrote a project in eclipse with an older version of java. Now on a different computer but running the same codes I\'m getting a whole lot of red.

This is due to Ve

相关标签:
3条回答
  • 2020-12-01 18:51

    In myeclipse select the project -> properties -> java compiler -> there you can specify jdk version.

    0 讨论(0)
  • 2020-12-01 18:59

    In eclipse go to Window -> Preferences -> Java -> Compiler, there you can change the java versions. Hope it helps.

    0 讨论(0)
  • 2020-12-01 19:09

    Ideally if we want to have two different versions of Java [say 1.6 and 1.7], then we should have two workspace defined accordingly to avoid any mixup. We can also change the Project Facets if our projects has facets that is.

    In Eclipse Follow steps given below: 1) Windows -> Preferences -> Java -> Compiler and as per the image set the compliance compiler level as per your requirements. Compiler Compliance Level Not Project Specific

    2) Windows -> Preferences -> Java -> Installed JRE's and check if your required jre/jdk is available or not as given in image below: Installed JRE's Not Project Specific

    3) Right Click on Your Project and go to Java Build Path and check if your required Library is available or not as per image given below: Java Build Path Project Specific

    4) Now you can edit the JRE System Library or add one by clicking on button's available on last image's right side, then a pop up as given below will open up. Here, you can change the execution environment [default values also can be set] Edit/Add Library

    0 讨论(0)
提交回复
热议问题