What I understand is you want something that can compile all types of Java projects (NetBeans, Eclipse, etc.)
Sorry to say this but there isn't one that can compile all the formats out there. But you could write your own, for at least the most common types of formats that you receive from the students.
Check out this page for more information: Building Java Projects.
What I suggest is, start by studying the build architecture used by those tools (NetBeans, Eclipse, etc.) and come up with a build script of your own that can extract the class paths of all the classes in the java project. Let your script do the work for you!
If you don't wish to write your own scripts, then you may consider changing the projects you receive into a standard project format. Check out this and this link to see more about migrating from Ant to Maven or Maven to Ant.
Else, you can always manually port your existing projects into other IDE, provided they follow the same build mechanism. Check out this answer to know more.