Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception in thread "main" java.lang.Error: Unresolved compilation pro

Status
Not open for further replies.

user9876

IS-IT--Management
Jun 5, 2003
63
CA
I have just begun to look at Java and in a tutorial, there is an example which uses eclipse as the ID. On my home computer i entered the following:

package intro.core;

public class Adult {
protected int age;
protected String name;
protected String race;
protected String gender;

public static void main(String[] args) {
Adult myAdult = new Adult();

System.out.println("Name:" + myAdult.name);
System.out.println("Age:" + myAdult.age);
System.out.println("Race" + myAdult.race);
System.out.println("Gender:" + myAdult.gender );

}

}

and i get the error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Adult.main(Adult.java:2)

but if i enter it at work, it works fine.

Does anyone have any ideas what could be wrong. If i was using different versions of Java, would that be the cause?
 
Please do not post standard Java questions in this forum - it is for J2EE questions only !

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top