102

When trying to start my JUnit-Test out of Eclipse, I get a "ClassNotFoundException". When running "mvn test" from console - everything works fine. Also, there are no problems reported in Eclipse.

My project structure is the following:

  • parent project (pom-packaging)
    • Web project (war-packaging - my JUnit-test is in here)
    • Flex project
    • Configuration project

edit: How can the class not be found? It's a simple HelloWorld-Application with no special libraries.

Here's my JUnit's run-configuration: alt text http://www.walkner.biz/_temp/runconfig.png


Testclass (but as I said; it doesn't work with a simple HelloWorld either...):

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import biz.prognoserechnung.domain.User;
import biz.prognoserechnung.domain.UserRepository;
import biz.prognoserechnung.domain.hibernate.UserHibernateDao;

public class UserDaoTest {
/**
 * the applicationcontext.
 */
private ApplicationContext ctx = null;

/**
 * the user itself.
 */
private User record = null;

/**
 * Interface for the user.
 */
private UserRepository dao = null;

@Before
public void setUp() throws Exception {
String[] paths = { "WEB-INF/applicationContext.xml" };
ctx = new ClassPathXmlApplicationContext(paths);
dao = (UserHibernateDao) ctx.getBean("userRepository");
}

@After
public void tearDown() throws Exception {
dao = null;
}

@Test
public final void testIsUser() throws Exception {
Assert.assertTrue(dao.isUser("John", "Doe"));
}

@Test
    public final void testIsNoUser() throws Exception {
    Assert.assertFalse(dao.isUser("not", "existing"));
        Assert.assertFalse(dao.isUser(null, null));
        Assert.assertFalse(dao.isUser("", ""));
    }
}
Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
swalkner
  • 16,679
  • 31
  • 123
  • 210
  • 3
    I get the same error when trying to run a simple HelloWorld class with no JUnit included... More exactly: java.lang.NoClassDefFoundError: HelloWorld Caused by: java.lang.ClassNotFoundException: HelloWorld – swalkner Jun 27 '09 at 15:14
  • ClassNotFoundException is thrown when trying to reflect on a class. NoClassDefFoundError is thrown when you are trying to use the class in a normal method call. – akf Jun 27 '09 at 15:16
  • can you show the code for your test class? – akf Jun 27 '09 at 16:13
  • do you have build automatically turned on or off? – Jonathan Holloway Jun 27 '09 at 18:07
  • build automatically is turned on – swalkner Jun 27 '09 at 19:26
  • Thanks a lot to Carlos.My problem is solved. Link to carlos post : –  Aug 22 '11 at 16:52
  • Thanks a lot to Carlos.My problem is solved. Link to carlos post : http://stackoverflow.com/questions/1052978/eclipse-java-lang-classnotfoundexception/1062435#1062435 –  Aug 22 '11 at 16:54
  • First of all avoid creating a .java class with a main method in the project. If its created the project will start its execution from main and if its deleted in future the project wont work well. If so happens kindly go to run-> run configurations-> java-> right click on main class-> delete the class. now your project is ready to run. – Soudamini Feb 09 '17 at 04:06

44 Answers44

201

I've come across that situation several times and, after a lot of attempts, I found the solution.

Check your project build-path and enable specific output folders for each folder. Go one by one though each source-folder of your project and set the output folder that maven would use.

For example, your web project's src/main/java should have target/classes under the web project, test classes should have target/test-classes also under the web project and so.

Using this configuration will allow you to execute unit tests in eclipse.

Just one more advice, if your web project's tests require some configuration files that are under the resources, be sure to include that folder as a source folder and to make the proper build-path configuration.

starball
  • 20,030
  • 7
  • 43
  • 238
Carlos
  • 2,883
  • 2
  • 18
  • 19
  • 1
    Hi Carlos, thanks a lot for your advice. But it didn't help, unfortunately. I added /src/main/java (target/classes) and /src/test/java (target/test-classes) to the source folders as well as src/main/resources (applicationContext.xml, some properties - target/classes). Same problem - when starting my src/test/java/UserDaoTest.java as JUnit-test from Eclipse, I get "Class not found UserDaoTest java.lang.ClassNotFoundException: UserDaoTest". At least, that's a little bit different then the original error message... – swalkner Jul 01 '09 at 05:37
  • 5
    You're on the right way, check whether the UserDaoTest class is in the corresponding output folder within your file system (As you may know, Eclipse does compile all your source files and place it into the specified output folder, among others, to be able to launch tests). If the class doesn't appear in the output folder, check the inclusion/exclusion filters of the build path for this specific folder. Good luck. – Carlos Jul 02 '09 at 10:23
  • For me this didn't fix the problem. Turned out that it was an AspectJ issue. If you're using AspectJ try removing and reading the AspectJ capabilities - worked for me – Stefan Haberl Jul 17 '12 at 08:29
  • 1
    Had same issue. I think it is an eclipse project - maven - git issue. That does not really narrow it down but wiping all the metadata folders (.project, .whatever...), deleting the project and reimporting only as a maven project worked for me. I also found something didn't know eclipse-junit could do: highlighting test method and selecting RunAs-Junit only runs that particular test-method, not the entire test! No more `@Ignore` all over the place and gui shortcuts! – bgs Oct 25 '12 at 14:46
  • Was facing the same issue, I simply used Eclipse -> Project -> clean and it worked. Mvn clean did not work. – Nutan Jun 30 '20 at 13:00
  • I had a similar issue, and this didn't work. In case this helps anyone, what ended up working for me what that I apparently had a disallowed character in the project name (a colon in my case). Once I removed that, it worked. – ElliotThomas Nov 09 '22 at 17:07
47

Carlos approach helped! Eclipse - java.lang.ClassNotFoundException

Try to check the classpath of the junit run configuration:

  1. Open your run configurations
  2. Click on the jUnit-Test you want to start
  3. go to the classpath tab
  4. Try to add a folder (click on user entries, click on advanced, click on add folders, click on ok and search the outputfolder for your test classes(those you find under projektproperties java build path, source))

works for me.

Community
  • 1
  • 1
CoffeJunky
  • 1,087
  • 1
  • 12
  • 15
  • 2
    Isn't this very strange? It worked for me, but the target classes dir is part of the build classpath for the project. Doesn't make much sense that you need to add a specific class. – Jose Muanis Aug 19 '11 at 14:59
  • I don't think this action necessarily adds a needed directory as much as triggers something to be reloaded. You can likely immediately remove the newly added directory after a successful run and it should work like normal. Also, comment above is right. May want to upvote the referenced commend from Carlos as well. – awied Mar 23 '12 at 14:10
  • I found the answer on another SO question to be more helpful with this problem: http://stackoverflow.com/a/5718520/901641 – ArtOfWarfare Nov 06 '13 at 04:10
17

your build classpath is correct, which is why you can compile. the classpath for your JUnit needs to be checked. go to the Run menu and choose 'open run dialog.' in there you should see a tree on the left with JUnit as an option. open that node and find and select your test. on the right pane you will see a tab for classpath. take a look to ensure that your class that the test is trying to instantiate would be found.

edit:

this seems to be an issue with maven and its behavior after a release changed the default Eclipse output folders. i have seen solutions described where

  • placing maven into the bootclasspath ABOVE the jre works, or
  • running mvn clean test does the trick or
  • refreshing all of your eclipse projects, causing a rebuild fixes the problem
  • going to your project and selecting Maven->Update Configuration solve the problem

with the first three, there were reports of the issue recurring. the last looks best to me, but if it doesnt work, please try the others.

here and here is some info

akf
  • 38,619
  • 8
  • 86
  • 96
  • 1
    unfortunately, "Maven => Update Configuration" does not solve the problem at all... the reverse is true; it delete's the build path configurations... Or does that mean that some other configuration is bad? – swalkner Jul 01 '09 at 18:53
  • Exactly as @swalkner pointed out: Maven => Update configuration will ruin the build path configuration. For some reason which eludes me the plugin will set exclusion filters which I always have to remove manually after running the command – Stefan Haberl Jul 17 '12 at 08:19
  • "go to the Run menu and choose 'open run dialog.' Huh?? Where's that? – Berit Larsen Aug 24 '15 at 12:03
8

Enabling [x] Use temporary JAR to specify classpath (to avoid classpath length limitations) inside the Classpath tab of the Run configuration did the trick for me.

If your project is huge and you have lots of dependencies from other sibling projects and maven dependencies, you might hit the classpath length limitations and this seems to be the only solution (apart from making the directory to you local maven repo shorter (ours already starts at c:/m2)

enter image description here

user3018906
  • 571
  • 5
  • 6
5

The problem might be missing the class file in your build folder. One solution is clean the project and rebuild it.

EvilFish
  • 51
  • 1
  • 1
3

There are many convoluted suggestions here.

I've encountered this problem multiple times with Maven projects after moving resources around by drag 'n' drop, or performing refactoring of class names.

If this occurs, simply copy (not move) the problem Test Case (.java) via terminal/file browser to another location, right-click -> Delete in Eclipse and choose to delete on disk when given the option, move/copy the copied file to the original file location, then select your project in Eclipse and press F5 to refresh resources.

This is quick and easy to do, and has fixed the problem permanently for me every time.

KomodoDave
  • 7,239
  • 10
  • 60
  • 92
  • I'm tempted to ask whether it's fixed your problem _permanently_, or _every time_... but I get what you mean, and, amazingly, this did the trick for me. – Amos M. Carpenter Dec 11 '15 at 01:19
2

We had the exact exception (using SpringSource Tools, tomcat, on Win7) and the cause was that we had refactored a filename (renamed a file) from SubDomain.java to Subdomain.java (D vs d) and somehow it collided though SpringSource was showing the new name Subdomain.java. The solution was to delete the file (via SpringSource) and create it again under the name Subdomain.java and copy-pasting its former content. Simple as that.

Romie
  • 21
  • 1
  • I always runned junit test cases, until I runned the program that checks PC for compatibility before upgrading windows. That seemeed to break something, I'm unable to run JUnit test cases again. (and all existing answers don't work) – CoffeDeveloper Sep 03 '15 at 11:49
2

I had the exact same problem but I figured it out! Go to your project file and right click on it, then click Refresh or hit F5. Then try and run it. If it still doesn't work then just forget it, as I had the EXACT same problem and it just means you version of Eclipse is garbage.

jonsca
  • 10,218
  • 26
  • 54
  • 62
Starfox275
  • 37
  • 1
2

This was my solution to the problem. Of course, many things can cause it to occur. For me it was that Maven2 (not the plugin for Eclipse) was setting the eclipse profile up to use a different builder (aspectJ) but I did not have the plugin in eclipse./

http://rbtech.blogspot.com/2009/09/eclipse-galileo-javalangclassnotfoundex.html

Cheers Ramon Buckland

2

JUnit test from inside eclipse gave me also NoClassDefFoundError. Running 'mvn clean test' from command line gave me following error on several jars: invalid LOC header (bad signature) Deleting these jars from local m2 repository and running 'mvn clean test' again solved my problem.

RutgerDOW
  • 41
  • 2
2

Sachin's right: Even with correct class path, the problems tab will show that some dependency or the Resource/project has error that needs to be fixed in order for maven to automatically build and create classes when you create or make a change in your test class.

"Hi,

Its very Old Jul (which year) but I had the same problem .

Actual issue found that eclipse was not able to generate class file for the java file , classpath was proper.

See the problem tab and check if your project is missing something/file. you can create a new proj and add files one by one and build them until it stops compiling and creating classes ( check the workspace/proj/bin/package/ folder for classes )

its wierd but true , ecplise was failing in compliation because 4 of 20 java files were using a single image which was missing. and as result none of the java file was compiled .

CLASSPATH is not a issue here."

kisna
  • 2,869
  • 1
  • 25
  • 30
1

All I did was Properties -> Java Build Path -> Order and Export -> Enabled all unchecked boxes -> moved Junit all the way up

Siddharth
  • 9,349
  • 16
  • 86
  • 148
1

Tried

Link : [here][1]

Open your run configurations
Click on the jUnit-Test you want to start
go to the classpath tab
Try to add a folder (click on user entries, click on advanced, click on add folders,click on ok and search the outputfolder for your test classes(those you find under projektproperties java build path, source))

worked after

Maven 2 LifeCycle >> test

user2246725
  • 470
  • 1
  • 6
  • 9
1

I had tried all of the solutions on this page: refresh project, rebuild, all projects clean, restart Eclipse, re-import (even) the projects, rebuild maven and refresh. Nothing worked. What did work was copying the class to a new name which runs fine -- bizarre but true.

After putting up with this for some time, I just fixed it by:

  1. Via the Run menu
  2. Select Run Configurations
  3. Choose the run configuration that is associated with your unit test.
  4. Removing the entry from the Run Configuration by pressing delete or clicking the red X.

Something must have been screwed up with the cached run configuration.

Gray
  • 115,027
  • 24
  • 293
  • 354
  • 1
    After too much time wasted I ended up doing the steps above. I then took a heroic decision to delete all run test configurations and now none of my tests can be found in the classpath even though the new run configuration clearly shows the project in it (with maven dependencies underneath). I keep forgetting how brittle eclipse is. After that no tests could be run with eclipse (before i could select a particular test - ok). Finally, I tried KomodoDave suggestion below. That fixed things... amazing the loops you have to jump through with this ide (the latest of a series..) – justin Aug 13 '14 at 12:48
1

I had the same problem. All what I did was,

i). Generated Eclipse artifacts

mvn clean eclipse:eclipse

ii). Refresh the project and rerun your junit test. Should work fine.

Vikram
  • 2,042
  • 3
  • 14
  • 15
1

while running web applications Most of us will get this Exception. When you got this error you have place .class files in proper folder.

In web applications all .class files should sit in WEB-INF\Classes folder. if you are running web app in Eclipse please follow the steps

Step 1: Right click on Project folder and Select Properties Step 2: Click on "Java Build Path" you will see different tabs like "source" , "projects", "libraries" etc Step 3: select Source folder. under this you will see your project details Step 4: in the "Source" folder you will see Default Output Folder option. here you have to give the classes folder under WEB-INF. just give the path like projectname/WebContent/WEB-INF/classes the structure depends on your application please do remember here you no need to create "classes" folder. Eclipse will create it for you. Step 5: click on "OK" and do the project clean and Build. that's it your app will run now.

Sahitya M
  • 11
  • 4
1

I solve that Bulit path--->libraries--->add library--->Junit check junit4

wanfke
  • 19
  • 2
1

Usually this problem occurs while running java application java tool unable to find the class file.

Mostly in maven project we see this issue because Eclipse-Maven sync issue. To solve this problem :Maven->Update Configuration

Premraj
  • 72,055
  • 26
  • 237
  • 180
1

I suggest trying adding this to the VM arguments;

-verbose:class -verbose:module -Xdiag

Then you can debug it from Eclipse which should print out some message like;

java.lang.ClassNotFoundException: org.adligo.somewhere.Foo
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:398)
    at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:760)
    at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:655)

From this you can set a breakpoint on LancherHelper.java 760 to debug the Eclipse Lanucher itself. In my case I noticed that user classpath appeared to be null, even though I have many jars in it in the Lanuch config.

Adligo
  • 51
  • 2
1

Make sure if your test class working before , but you facing issue all of sudden. then clean your project and build it again. Make sure project has been configured in build path as read above article.

1

Well, you can solve this problem basically by creating a new project.

  1. Close the project (save the code in another folder on your computer).
  2. Create a new project (add a new final directory and do not leave the default directory selected).
  3. Remake your previous project adding the code saved before.

This happens because probably you created a project and didn't select a directory/folder or something like that. I hope had helped you!

HoRn
  • 1,458
  • 5
  • 20
  • 25
1

click on project->properties->Java build path->Source and check each src folder is still valid exist or recently removed. Correct any missing path or incorrect path and rebuild and run the test. It will fix the problem.

Nick
  • 4,302
  • 2
  • 24
  • 38
iunknown
  • 11
  • 2
0

Please point to correct JDK from Windows > Preferences > Java > Installed JRE.

Do not point to jre, point to a proper JDK. I pointed to JDK 1.6U29 and refreshed the project.

Hereafter, the issue is gone and jUnit Tests are working fine.

Thanks,
-Tapas

Tapas Adhikary
  • 162
  • 2
  • 13
0

I've run into a same error in Eclipse recently, i.e., the Eclipse IDE couldn't find the Unit test class no matter how I change the configurations. Learning from the previous posts here and in other web sites, I've double checked and triple checked the classpath and source info, and move up and down the source folder and libraries, in both the "Run Configuration" and the "Java Build Path" config windows, and I've also cleaned the Project and rebuilt it, but none of the tricks work for me. The specific Java project is an old ANT compiled project and have lots of jars included in Eclipse library.

Then, I changed the unit test class to add a main() method and right click it to "Run As" a Java Application instead of JUnit test, and suddenly, Eclipse seems to wake up and identified the class correctly. Afterwards, I switched it back to a Unit test application, and it is still working.

This seems to be a bug in Eclipse, I am guessing the large number of libraries (>260) may confused the JVM's ability to locate my JUnit class.

HZhang
  • 175
  • 12
0

I tried everything I read in this long post and, incredibly, what worked for me was, rather than clicking on the test class and selecting Run as JUnit test, clicking on the test method and running as JUnit test. I have no idea why?

Satpal
  • 132,252
  • 13
  • 159
  • 168
snakedog
  • 357
  • 1
  • 2
  • 13
0

Deleting the project from eclipse (Not from hard disk) which in a way is cleaning the workspace and reimporting the project into eclipse again worked for me.

0

Changing the order of classpath artifacts in the Java Build Path resolved it for me.

  1. Right Click on the project and go to Project Build path.
  2. Go to, Order and Export tab and move the JRE system library to after the sources.

This should fix it.

0

JUnit 4.4 is not supported by the JMockit/JUnit integration. Only versions 4.5 or newer are supported that.

Mahendra Rathod
  • 128
  • 1
  • 1
  • 11
0

I have see Eclipse - java.lang.ClassNotFoundException when running junit tests. I had deleted one of the external jar files which was added to the project. After removing the reference of this jar file to the project from Eclipse. i could run the Junit tests .

  • What if the external jar file is important to the application and necessary for some functionality of the app? I'm not sure this is a viable solution. – Carl Poole Mar 01 '17 at 04:54
0

Go To Build Path -> Source and toggle to Yes option "Ignore Optional Compile Problems" for all source folders.

pavelb
  • 41
  • 2
0

I faced the same problem, for me the issue is different. It came because some of the maven dependencies are not downloaded.

a. I went through properties -> Java Buildpath -> Maven Dependencies and identified the missed libraries. 
b. Removed the missed libraries artifacts from pom.xml
c. Downloaded the libraries and added them explicitly.
Hari Krishna
  • 3,658
  • 1
  • 36
  • 57
0

I was hit with this issue also and was able to come up with a sufficient solution for my case. If your Eclipse project has a .classpath file in your project root (see it in Navigator view instead of Package Explorer view), be sure that your Maven classpathentry appears prior to your JRE Container classpathentry.

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
</classpath>

If your project does not have a .classpath file, you can edit your project's Java Build Path to switch the Order and Export. If your project has the .classpath file and you only change your ordering in the Java Build Path, you will see that the ordering is not impacted and the issue will continue to occur.

And a project->clean never hurts things after you make the change.

Betlista
  • 10,327
  • 13
  • 69
  • 110
cmh
  • 41
  • 2
0

Run project as Maven test, then Run as JUnit Test.

Yao Li
  • 2,071
  • 1
  • 25
  • 24
0

Make sure your test launch configuration does NOT contain the following lines, OR try enabling automated Maven dependency management.

<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
Betlista
  • 10,327
  • 13
  • 69
  • 110
thSoft
  • 21,755
  • 5
  • 88
  • 103
0

If those don't work in eclipse try: Alt + Shift + X and you will see 5 options at the bottom right of your screen. Choose the Java Application and it'll work

0

For Hybris Project, I fixed the issue by applying below changes in Build Path. I selected Project and clicked on Apply and Close.

enter image description here

Mr.A
  • 41
  • 4
0

If you are in Eclipse run time, it means that you already need to export the required packages through Manifest.MF file.

Export-Package: Name of the Package

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 30 '23 at 06:14
0

You must have pom.xml file. You will get class not found error in one more case- if any of the dependency is not resolved- means corresponding jar is not downloaded in the repository.

I had similar issue and I tried cleaning, building project multiple times but not much help.

Then there below entry for this dependency which was showing as mising, then I manually downloade it and placed in the repository.

<dependency>
            <groupId>oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>${ojdbc.verison}</version>
        </dependency>

Then, Run -> maven clean Maven -> Update projects -> select the project -> force update snapshots and update offline.

This will resolve the issue.

RangaM
  • 19
  • 4
-1

Hmm, looks a little bizarre, try running it with the following annotation at the top of the class:

@RunWith(SpringJUnit4ClassRunner.class)
public class UserDaoTest {
}

and let me know how you get on with it.

Check that you have build automatically enabled as well. If you want to make sure your test classes are being compiled correctly clear out the Maven target folder (and any bin folder that Eclipse may be using). Are you using m2eclipse as well, as I find it to be a little problematic.

Jonathan Holloway
  • 62,090
  • 32
  • 125
  • 150
  • thanks a lot for your answer, but nevertheless: it doesn't work either; first, I have to include spring-test.jar, then another dependency is not fullfilled. i don't understand why it doesn't work with a simple helloworld-class in the same package. and there, i don't need a "hack" like the one suggested by you... something must be wrong with "classpath" or something similar, but i don't get where/what i have to check... – swalkner Jun 27 '09 at 20:08
-1

Furthermore, DOUBLE-CHECK the eclipse "Web Deployment Assembly" dialog.

This can be found: Project Properties->Deployment Assembly.

Recently I had an eclipse plugin modify one of my web projects, and it added ~mysteriously~ added the maven test directories /src/test/java, /src/test/resources to the Deployment Assembly. UGGGG!!!

Which is why my project worked fine when I built & deployed just straight maven to tomcat, no ClassNotFoundExceptions... However, when I did the deploy through Eclipse, Whammo!! I start getting ClassNotFoundExceptions because the TestCode is getting deployed.

Eric

Eric Manley
  • 1,049
  • 10
  • 8
-1

That means your pom.xml has unresolved issues. Open the problems view solve accordingly. Then you will be able to run the test cases successfully without encountering the classnotfoundexception.

Raju Guduri
  • 1,237
  • 1
  • 13
  • 25
-1

The solution to my problem which was similar: the libs were invalid. If you look in the .classpath file of the project, you'll see classpathentry tags with the key/value kind="lib". Some of mine were incorrect.

I didn't discover this until I turned off Validation settings. That is, there were so many errors in the JSP files, etc, that the classpath errors weren't evident (or possibly even showing up). As a result, nothing was being compiled into the destination output folders, but no helpful errors on why.

Mike
  • 257
  • 3
  • 3
-1

I am using gradle with eclipse and faced the same challenge today and tried a number of ways to resolve but the only way which helped me was to run command gradlew clean .

P.S. => Don't combine the "build" with the above mentioned command.

Helped me, try your luck.

-2

Its very Old Jul (which year) but I had the same problem .

Actual issue found that eclipse was not able to generate class file for the java file , classpath was proper.

See the problem tab and check if your project is missing something/file. you can create a new proj and add files one by one and build them until it stops compiling and creating classes ( check the workspace/proj/bin/package/ folder for classes )

its wierd but true , ecplise was failing in compliation because 4 of 20 java files were using a single image which was missing. and as result none of the java file was compiled .

CLASSPATH is not a issue here.

Sachin
  • 1