[TxMt] Re: Java Compile and run

Michael Sheaver msheaver at earthlink.net
Sun Sep 9 15:57:34 UTC 2012


> [?] 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).


No, it is only a single file. My wife is taking a beginner class in Java programming, and I am trying to set up a simple environment on our Mac in which she can do her homework. As she is using only very simple single files, and I want her to concentrate on the code and not the programming environment, I would like to enable her to simply press Command-R to compile and run the code. However, it appears that the system is not automatically creating the needed .class file, as shown in the complete output here:
Exception in thread "main" java.lang.NoClassDefFoundError: helloworld
Caused by: java.lang.ClassNotFoundException: helloworld
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Given all this, what is the best way to configure this poor man's compile-and-run environment?

I have installed the latest iteration of Netbeans IDE, but it is way too much for my wife, at least for the moment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20120909/3610a6b6/attachment.html>


More information about the textmate mailing list