After I finish building from Ant, All my class files are imported into the classes folder inside target folder. I checked that the classes folder does indeed exist in my file system.
However, for some reason the eclipse does not recognize this folder. Every time I run a JUnit test, it always show this:
Class not found AbsenceReportControllerTest
java.lang.ClassNotFoundException: AbsenceReportControllerTest
at java.net.URLClassLoader$1.run(URLClassLoader.java:200
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
This folder also does not display in eclipse’s Package Explorer
I tried to project > clean and rebuild, close and restart the eclipse and typing F5, but none of those approaches works.
Could you please help me figure out how to solve this? Thanks
I found the solution, it is because I chose that folder to be my output folder in eclipse project > properties. I simply removed it from the .classpath file so that I can see it again.For eclipse kepler . Uncheck box for “allow output folder for source folder” in java build path.