NetBeans IDE 7.2.1 cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath
Asked Answered
H

2

9

I need help with android project inside NetBeans. I Just opened project which is created in NetBeans and I have some issues with "cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath" This is sample of one my file which have issues:

package Helpers;
import PreglednikLogika.Clanak;
import android.content.Context;

The first line package Helpers; is underlined and produce "cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath"

I am new with netbeans and I tried some fixes but not success. Can somebody help me ? I think this is adding reference library or something like that issue... but not sure.

Herra answered 2/1, 2013 at 17:31 Comment(0)
H
2

I just found what the problem was.

  1. I updated this path to my correct path sdk.dir=E:\\ANDROID\\Eclipse371\\android-sdk in project file local.properties.

  2. I updated project.properties file # Project target.target=android-8, to target 8 I had 7 before that obviously does not supported in this version of SDK.

and I successfully build my project :)

Herra answered 2/1, 2013 at 17:58 Comment(1)
Is this question about android.?Wershba
A
21

The project has an old hotspot, in Netbeans:

  • Right click the project
  • properties
  • libraries
  • update "Java Platform"

Not exclusive to Android, this happened to me while trying to compile a very old project.

Aryl answered 16/7, 2013 at 3:55 Comment(1)
I know this is old, but this helped me to get to the answer, thanks a lot :)Goofy
H
2

I just found what the problem was.

  1. I updated this path to my correct path sdk.dir=E:\\ANDROID\\Eclipse371\\android-sdk in project file local.properties.

  2. I updated project.properties file # Project target.target=android-8, to target 8 I had 7 before that obviously does not supported in this version of SDK.

and I successfully build my project :)

Herra answered 2/1, 2013 at 17:58 Comment(1)
Is this question about android.?Wershba

© 2022 - 2024 — McMap. All rights reserved.