Eclipse problem "This compilation unit is not on the build path of a java project"

Posted on 2007-11-14
Last Modified: 2013-12-15
I downloaded the Java EE version of the Eclipse IDE, simply be cause I'll be writing JSPs and other EJBs later on.

but first, I wanted to write a simple java program that involves printing out text.

For some strange reasons, I keep on getting the pop up
"This compilation unit is not on the build path of a java project"
every time I press the . key. It seems auto complete is running into some problems that I am not sure how to fix. Can someone teach me how to fix this?

I've defined my own class, and I wrote a test driver for it.

so I have a class like this.
public class testdriver(){
      public testdriver(){

System. gave me that problem already. let alone the custom class that I wrote.

Thanks in advance
Question by:SamsonChung
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

samalraj earned 500 total points
ID: 20280780
ensure that the project *is* a Java project and not just a Project --
Eclipse treats them slightly differently


Author Comment

ID: 20281092
Thanks, this just reminds me why I love Gel....

Expert Comment

ID: 20281143
Welcome :)

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
dangers of teaching programming 10 134
Java eclipse error 2 72
How to search for a String with special characters on git 2 152
Android studio getdrawable(int) is deprecated 4 160
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

756 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