We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Eclipse showing errors for no reason

Hi when I use ecclipse to run codes it shows many errors, and they are not errors at all I compiled them with command prompt and it work.

this is the image

http://i.imgur.com/az6Pg.jpg

My java and javac version is 7 u 2

5
Contributors
6
Replies
1 Day
Discussion Span
1 Year Ago
Last Updated
8
Views
ilovejava
Junior Poster in Training
77 posts since Sep 2011
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

what error messages do you get?

stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23

ex -
The import java.util cannot be resolved

Override cannot be resolved to a type

Implicit super constructor Object() is undefined. Must explicitly invoke another constructor

ilovejava
Junior Poster in Training
77 posts since Sep 2011
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

eclipse is not linked to the java libraries or they are not installed

To setup Eclipse to use the JDK you must follow these steps.

1.Download the JDK

First you have to download the JDK from Suns site. (Make sure you download one of them that has the JDK)

2.Install JDK

Install it and it will save some files to your hard drive. On a Windows machine this could be in c:\program files\java\jdk(version number)

3.Eclipse Preferences

Go to the Eclipse Preferences -> Java -> Installed JREs

4.Add the JDK

Click Add JRE and you only need to located the Home Directory. Click Browse... and go to where the JDK is installed on your system. The other fields will be populated for you after you locate the home directory.

5.You're done

Click Okay. If you want that JDK to be the default then put a Check Mark next to it in the Installed JRE's list.

Jaggs
Newbie Poster
15 posts since Mar 2012
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 2

I have the JDK installed but how do find the eclipse prefrences?

ilovejava
Junior Poster in Training
77 posts since Sep 2011
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

go to the eclipse menu options Window -> Preferences or you can right click on your project and select Build Path -> Add Libraries... from the context menue and select JRE System Library from the Add Library dialog box

ejosiah
Junior Poster
196 posts since Feb 2008
Reputation Points: 72
Solved Threads: 23
Skill Endorsements: 3

Sometimes when I am using Eclipse on different computers, I will have different JRE's installed. For example, I use JRE7 on one and the other has JRE6 installed. When I go from one to the other, Eclipse throws a ton of errors. So make sure whatever JRE you used to originally make the program is the same version as the one you're using now.

designuts
Newbie Poster
17 posts since Mar 2012
Reputation Points: 11
Solved Threads: 1
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0724 seconds using 2.71MB