Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJun Dong
4,754 PointsCannot find or load main class Example
When I try to run the program it says cannot find or load main class Example here's my code:
package com.teamtreehouse;
import com.teamtreehouse.Treet;
import java.util.Date;
public class Example {
public static void main(String[] args) {
Treet treet = new Treet("craigsdennis", "Want to be famous? Simply tweet about " +
"java and use the hashtag #treet. I’ll use your tweet in a new @treehouse course" +
" about data structures.",
new Date(1421849732000L));
System.out.printf("This is a new Treet: %s %n", treet);
}
}
Jun Dong
4,754 PointsOh it worked after deleted
package com.teamtreehouse;
Sean M
7,344 PointsEdit to response: Never mind, I see you figured it out which is good!
2 Answers
Rajbie Sarwar
4,772 PointsDid you save your program, and do:
javac Example.java && java Example
Jun Dong
4,754 Pointsyes but it still won't run
Sean M
7,344 PointsEdit to response: Never mind, I see you figured it out which is good!
Naval Kulkarni
13,782 PointsNaval Kulkarni
13,782 PointsAre you Running the program in an IDE?
if you are, then you need to edit your configurations for the project to reflect that your main method is in Example Class.