In this tutorial we will solve error Access restriction: The type 'Application' is not API (restriction on required library rt.jar)
Contents of page >
- Step 1.1: click Windows, Preferences,
- Step 1.2: Type jre
- Step 1.3: Select Standard VM >
- Step 1.4: JRE home and JRE name
- Step 2.1:click Windows, Preferences,
- Step 2.2: Type Execution Environment
- Step 2.3: Check jdk1.8.0_05 [perfect match]
- Step 3.1: click Windows, Preferences,
- Step 3.2: type error,
- Step 3.3: type deprecated, In Deprecated and restricted API -
STEP 1) Solution to problem is - set Jre to JDK in eclipse (If it's already there move to step 2)
Step 1.1:
click Windows, Preferences,
Step 1.2:
Type jre
Go to Installed JREs (which is under Java > Installed JREs)
Then click Add..
Step 1.3:
Select Standard VM >
Step 1.4:
Type >
JRE home: C:\Program Files\Java\jdk1.8.0_05\
JRE name: jdk1.8.0_05
Click Finish
Step 1.5:
Finally you will see screen like this >
Where you can see jdk1.8.0_05 is checked.
STEP 2) How to set Execution environment to Java (perfect match) in eclipse (If it's already there move to step 3)
Step 2.1:
click Windows, Preferences,
Step 2.2:
Type Execution Environment
Go to Execution Environment (which is under Java > Installed JREs > Execution Environment)
Then select JavaSE-1.8
Step 2.3:
Check jdk1.8.0_05 [perfect match]
Click OK
And now error Access restriction: The type 'Application' is not API (restriction on required library rt.jar) must be solved. If in case you are still facing problem go to step 3
STEP 3) SOLUTION TO > Access restriction: The type 'Application' is not API (restriction on required library rt.jar) >
Step 3.1:
click Windows, Preferences,
Step 3.2:
type error,
Go to Errors/warnings (which is under Java > Compiler > Errors/warnings)
Step 3.3:
type deprecated,
In Deprecated and restricted API -
- In Forbidden reference (access rules ) - Earlier Errors is selected. Now, select ignore.
- In Discourage reference (access rules) - select ignore.
And now error Access restriction: The type 'Application' is not API (restriction on required library rt.jar) is solved.