I have Max OS X 10.8.1 and am using TM 2.0 (9302), and am having trouble getting it to compile and run java code from within TM. It cannot find the class file, as shown here: Exception in thread "main" java.lang.NoClassDefFoundError: helloworld Caused by: java.lang.ClassNotFoundException: helloworld
My guess is that a needed environment variable is not set, but I cannot find any documentation on what to set. Any ideas?
On Sep 9, 2012, at 6:13 AM, Michael Sheaver msheaver@earthlink.net wrote:
[…] compile and run java code […] cannot find the class file […]
Do you have multiple sources?
The Compile & Run was initially done for just running a single Java file.
That said, the command does have some poor man’s build system support by allowing you e.g. to set TM_JAVA_FILEGLOB (presumably to “*.java”) which would call the compiler with all the matches (rather than just the current one).
The alternative would be to set CLASSPATH if you have your class files somewhere. The proper solution though is to use a build system (when you’re doing more than just a quick test).