Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » ClassNotFoundException when running JUnit tests(ClassNotFoundException when running JUnit tests)
ClassNotFoundException when running JUnit tests [message #896745] Thu, 19 July 2012 10:55 Go to next message
Kris Ram is currently offline Kris Ram
Messages: 7
Registered: July 2012
Junior Member
Hi guys,

I am using Eclipse Indigo (but I have noted the same problem with other versions as well) and my projects are Maven based. I import my projects as simple projects, but they get changed to Maven projects anyway. The build fails becuase it fails to find my toolchain, but the build works fine when using Maven on the command line. So I manually disable dependency management.

I often get the problem of ClassNotFoundException when running units tests, and for some reason the tests could not be found.

The error somehow goes away after a combination of reimporting,cleaning, mvn eclipse:eclipse etc...

I wanted to understand what is actually going on. Where is it storing the .class files? Why would it find it at some point and then after an 'mvn eclipse:eclipse' it throws ClassNotFoundException.
Could the problem be with the JUnit plugin on eclipse?

Cheers
kris
Re: ClassNotFoundException when running JUnit tests [message #896777 is a reply to message #896745] Thu, 19 July 2012 13:05 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1299
Registered: July 2009
Senior Member
In order for Eclipse to build class files a project has to be a Java project. If you import as a simple project there is no builder associated with the project so Eclipse has nothing to build.
Re: ClassNotFoundException when running JUnit tests [message #897194 is a reply to message #896777] Mon, 23 July 2012 02:29 Go to previous message
Kris Ram is currently offline Kris Ram
Messages: 7
Registered: July 2012
Junior Member
Hi David,

sorry my terminology was incorrect, by simple projects I actually meant Java projects (instead of Maven projects).

So would you know why the tests occasionally fails after an eclipse:eclipse is performed. Where does the JUnit plugin normally looks for its .class files?


Regards
Kris
Previous Topic:Help me please.
Next Topic:Not Able to Run Servlet in eclispe
Goto Forum:
  


Current Time: Sat Apr 19 13:20:50 EDT 2014

Powered by FUDForum. Page generated in 0.02619 seconds