Is it possible to run a testNG XML from java code, in a separate java project with the given path to the XML?
The simplest way to start test automation project from another one would be to sent command line command:
Process process = Runtime.getRuntime().exec("java org.testng.TestNG C:\path-to\testng.xml");
or call some parametrized .bat file so not to write lots of dependencies in java code. E.g.:
Process process = Runtime.getRuntime().exec("run-suite.bat C:\path-to\testng.xml");
java -cp [lots of *.jar files] org.testng.TestNG %1
May be you also need to deal with results and sure you'll have to handle possible exceptions.
Eclipse does a lot of voodoo behind the scenes to make sure everything is plugged together in a really big an robust way. Good for your development environment, but way overkill for production.
Java only knows to look in very specific places for bytecode to load into it's runtime.
If you want runtime flexibility to load classes within your gui from anywhere, it sounds like you will want to look into either extending the classloader so you can add to your classpath at runtime. Or do a more hacky solution and use reflection to bypass the scope of the standard classloader.
Here is an example of a custom classloader that can load jar files and search for class bytecode inside: http://kalanir.blogspot.com/2010/01/how-to-write-custom-class-loader-to.html
This question might be useful to go through as well as a couple of the answers are informative: https://stackoverflow.com/questions/7884393/can-a-directory-be-added-to-the-class-path-at-runtime
Another totally different option, if you don't want or need the ability to dynamically alter your classpath at runtime, would be to preemptively either add the folder your testng tests are in to your CLASSPATH environment variable, or move them to a folder that is already defined in your CLASSPATH.
Remember though, if those tests have any 3rd party dependencies, no matter what solution you choose. Make sure those get added too otherwise you'll just run into the same problem the moment your test tries to invoke it.