[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Code not compiling in eclipse

Posted on 2011-05-11
6
Medium Priority
?
610 Views
Last Modified: 2012-08-13
I am trying to set up an existing project in eclipse. After creating the project, when I open any of the source files, it gives me errors like

the type java.lang.String cannot be resolved. It is indirectly referenced from required .class files

Can someone please let me know what settngs do I need to make to have it compiled with Java. Java is already set is the Path environment variable of the system. I am able to execute Java commands from command prompt. Do I need to do something in eclispe as well?

Thank you
0
Comment
Question by:ank5
6 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 1200 total points
ID: 35739671
0
 
LVL 23

Assisted Solution

by:cmalakar
cmalakar earned 400 total points
ID: 35739695
check if you have JRE_SYSTEM_LIBRARY in build path.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 400 total points
ID: 35739761
>>Java is already set is the Path environment variable of the system.

Try setting JAVA_HOME to the installation directory of the jdk
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:ank5
ID: 35739946
>>check if you have JRE_SYSTEM_LIBRARY in build path.

No it is not there. How do I add it?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35739961
Hit "Add Library ...", Select "JRE System Library" and add the appropriate JRE for the project (eg. 'Workspace default JRE')

Hit "Finish" in the library selection and "OK" in the project properties and then wait for the re-build of the project

see link above
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35739966
Go to properties of project with the build error (right click > Properties)

View the "Libraries" tab in the "Build Path" section

Find the "JRE System Library" in the list (if this is missing then this error message is not an eclipse bug but a mis-configured project)

Remove the "JRE System Library"

Hit "Add Library ...", Select "JRE System Library" and add the appropriate JRE for the project (eg. 'Workspace default JRE')

Hit "Finish" in the library selection and "OK" in the project properties and then wait for the re-build of the project

Hopefully the error will be resolved ...

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses
Course of the Month18 days, 11 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question