Cannot resolve java.lang.object type - Eclipse build path does not work

I have a problem with Eclipse from Mac OSX Mountain Lion. I recently installed the Android SDK and in my java projects I received the following message:

The java.lang.Object type cannot be resolved. This is indirectly referenced from required .class files

Considering this problem , it would seem that I do not have the correct JRE defined in the build path of my project. Checking the project creation path using the properties> Java Build Path> Libraries. I see that there is a JRE system library next to it. However, when I click Add Library ...> JRE System Library, I get a message:

An error has occurred. See Error Log for more details. java.lang.NullPointerException

Then I try to click Eclipse> Preferences> Java> Installed JREs and see an empty list. I am trying to add ... a standard virtual machine, but I cannot find the location of my JRE./Library/Java/JavaVirtualMachines/ empty and /System/Library/Frameworks/JavaVM.framework does not exist.

Does anyone know how I can fix this problem?

+6
source share
3 answers

This worked for me:

  • Right click on your project -> Build Path -> Configure Build Path
  • Go to the Libraries tab
  • Click "Add Library" → JRE System Library → Next → Default JRE Workspace (or you can add Alternate JRE) → Done
+7
source

Right button in the project: build path → Configure build path → Click JRE System Library → Remove

Then click: Add Library → JRE System Library → Next → Installed JREs → Select JRE → Ok → Finish → Apply

+4
source

You can follow the instructions to install JDL (which includes JRE) for Mac here .

Depending on your processor, the downloaded file has one of the following names:

  • jdk-8uversion-macosx-amd64.dmg
  • jdk-8uversion-macosx-x64.dmg

If version is version 6 or later.

  • Download the file.
  • Before a file can be downloaded, you must accept the license agreement.
  • From the browser download window or from the file browser, double-click the .dmg file to launch it.
    The Finder window appears containing the open field icon and the .pkg file name.
  • Double-click the package icon to launch the Setup application.
0
source

Source: https://habr.com/ru/post/973889/


All Articles