I recently faced a problem when I was trying to run a junit test in eclipse. I was getting a ClassNotFoundExcpetion. So, I googled a bit and tried out a solution where I had to move the JRE System Library below the rest of the jars and it worked!!! But I couldn't find and apt explaination on why I needed to do that. Can anyone let me know?

Recommended Answers

All 15 Replies

When I said I moved JRE Sytem Library below, I meant in the build path.

To be more precise. It started working after I moved the JRE System Library below the junit jar in the build path.

Above description wouldn't help in solving your issue. If your build is dependent on JRE System Library above/below JUnit.jar it is plainly obvious you are dependent on IDE and your project will not build sucessfuly from command line, therefore cannot be run from CI. I do strongly suggest to check out Gradle or Maven

though I do wonder what he's done that makes his eclipse project's compiling dependent on the order of dependencies in the project settings window :)

though I do wonder what he's done that makes his eclipse project's compiling dependent on the order of dependencies in the project settings window :)

I do remember NetBeans being funny back in the day while building JME app and you messed up order ;)
But hey then I been student and had no clue about building tools, and been happy IDE did it for me :D

Maybe created a class with the same name as a JRE class that was imported with a .* ?

Maybe created a class with the same name as a JRE class that was imported with a .* ?

Not really. The name of the class is definitely not related to the name of a JRE class.

you compared it to every class in the JRE?
it doesn't even need to be that class. I remember a guy having created his own String class, and later on not understanding why
public static void main(String[] args){

was compilable, yet not usable as an entry point for the application.

This is easilyy resolved... what are the names of all the classes in your app?

I'm a little hesitant to reveal the names of the classes that I'm working on(Not my classes). But it would be great if you would guide me on how to verify myself.

Any class you use.

Well, it doesn't match any. I'm marking this solved. Lets not drag it. Thanks for you input guys.

Well for the future it will be better if you can post small sample where you can demonstrate issue as above problem description obviously was not clear

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.