I was really excited to find this tcl/java system, and I must say it works well!
The bundled tjc is quite an impressive library, but it silently failed to compile my procs. I discovered this by benchmarking and noticing no difference in compiled/non-compiled procs.
Running this TCL showed the error:
package require TJC
proc test {} { eval 1 + 1 }
TJC::compile test -readyvar my_hello_ready
vwait my_hello_ready
puts $my_hello_ready
Error:
FAIL ::item3 TclException:\\ java.lang.ClassFormatError:\\ Unrecognized\\ class\\ file\\ format\\ version\\ 51/0\\n\\ \\ \\ \\ while\\ executing\\n\\\"java::new\\ \\{org.codehaus.janino.SimpleCompiler\\ boolean\\}\\ 1\\\"\\n\\ \\ \\ \\ (procedure\\ \\\"initJavaCompiler\\\"\\ line\\ 1)\\n\\ \\ \\ \\ invoked\\ from\\ within\\n\\\"initJavaCompiler\\\"\\n\\ \\ \\ \\ (procedure\\ \\\"processJavaSource\\\"\\ line\\ 1)\\n\\ \\ \\ \\ invoked\\ from\\ within\\n\\\"processJavaSource\\ Item3Cmd\\ \\{//\\ TJC\\ implementation\\ of\\ procedure\\ item3\\nimport\\ tcl.lang.*\\;\\n\\npublic\\ class\\ Item3Cmd\\ extends\\ TJC.CompiledCommand\\ \\{\\n\\ \\ \\ \\ publi...\\\"
This issue is filed with Janino <http://jira.codehaus.org/browse/JANINO-148?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab> and is patched in their 2.6.2 version (unreleased currently, get from svn).
This won\'t work right away because Janino\'s changes broke capatibility with tjc. You might be able to get it working by modifying initJavaCompiler.java.
After much effort, I discovered that TJC is also setup to compile with pizza. http://pizzacompiler.sourceforge.net/
It worked.
Simply download the jar off pizza's website and include it as part of your class path (and remove janino in case there is conflicts). Also make sure the jar is in the same directory as tjc (this might matter). That\'s it.
If possible, if the maintainers could swap out the janino jar with the pizza one that would re-enable compatibility with the latest java and tjc.