Jacl and Eclipse edit
During Jan, 2007, Patrick Finnegan posted a HOWTO for running Jacl with Eclipse as an external tool [1]. I'll include his notes here, so that as refinements are found, they can be incorporated.
It's now possible to run JACL with the Eclipse IDE as an external tool.
Installation Instructions
1. Install Java.
- Download the java runtime from http://www.java.com and install on your machine.
2. Download JACL
- Download the JACL 1.4.0 jaclBinary140.zip binary from http://sourceforge.net/projects/tcljava/
3. Extract the binary.
- Extract jaclBinary140.zip to a local directory e.g. C:/Downloads/jacl/jaclBinary140/jacl140/lib/tcljava1.4.0.
4. Install the jar files.
- JACL enable the Java runtime by copying the JACL jar files from the extract directory to the ext directory of the java install. The JACL jar files will be dynamically loaded by the JVM at runtime, e.g. copy the following jar files from C:/Downloads/jacl/jaclBinary140/jacl140/lib/tcljava1.4.0 to C:/Program Files/Java/jre1.5.0_10/lib/ext.
itcl.jar jacl.jar janino.jar tcljava.jar tjc.jar
5. Test the installation by starting an interactive shell.
C:/>java tcl.lang.Shell % # enable Java commands. % package require java 1.4.0 % # get local ip address. % java::import java.net.InetAddress % puts "My IP Address is: [[java::call InetAddress getLocalHost] getHostAddress]" My IP Address is: 123.45.67.89
6. Install Eclipse.
- Download Eclipse from www.eclipse.org and install to a local directory. If there is more than one java runtime installed on machine ensure the one used by Eclipse has the Jacl jar files in its ext directory.
7. Install Eclipse Tcl Plugin.
- Download the Eclipse Tcl plugin from http://www.eclipsedltk.org/ and install into Eclipse. Simply follow the standard plugin installation procedure and copy the eclipse directory in the zip file over the eclipse install directory.
8. Create a Tcl project.
- Start Eclipse and create a Tcl Project: File → new → other → Tcl Project. Create a Tcl file called quickTest.tcl in the project: File → new → other → DLTK Tcl → Tcl File. Add the following commands to quickTest.tcl then save.
clock format [clock seconds] package require java puts "current directory is [java::call System getProperty user.dir]" java::import java.net.InetAddress puts "My IP Address is: [[java::call InetAddress getLocalHost] getHostAddress]"
9. Configure JACL as an external tool.
- Create a new external tool: Select run → external tools → external tools. Double click on program. Set the following parameters.
-
name
- jaclShell location
- Java installation directory. E.G. C:/Program Files/Java/jre1.5.0_10/bin/java.exe working directory
- ${container_loc} - This resolves to the folder location of quickTest.tcl in Eclipse. arguments
- tcl.lang.Shell ${resource_loc} ${resource_name} - resolves to the location of the selected tcl file which in this case is quickTest.tcl.
- Close the dialog.
10. Select and run quickTest.tcl.
- Click once on quickTest.tcl to highlight. From the top menu select run → external tools → jacLShell. Do not right click → runas. The following is written to the Eclipse console.
current directory is C:/EclipseWorkSpaces/JaclScripts/testScripts My IP Address is: 123.45.67.89
11. And the whole point of this exercise is…
- Well it's really code management and the convenience of having Jacl and Java packages in the same workspace.