I want to determine the class name where my application started, the one with the main() method, at runtime, but I\'m in another thread and my stacktrace doesn\'t go all the
I suggest to put this information into a system property. This is usually simple to do when you start your application from a script.
If you can't do that, I suggest to set the property in the main() method of every application. The most simple way here would be to have every app derive it's "main class" from a common base class and run an init step in there. I often do this for command line processing:
public class Demo extends Main {
main(String[] args) {
Main._main(new Demo (), args);
}
// This gets called by Main._main()
public void run (String[] args) {
}
}