Hecl is easy to compile and install as a standard J2SE application.
This is only necessary if you'd like to work on Hecl's source code. If all you want to do is use it, or install it on your mobile phone, these steps aren't necessary - the standard distribution contains everything you need.
On Microsoft Windows, you must add your java
You will need to install these software packages if you want to rebuild Hecl.
|Obviously, you need a Java SDK - we suggest something recent like 1.5 or 1.6, as that's what most of the Hecl developers have.|
|Depending on what you want to utilize Hecl for, you'll want one or both of the Sun Java Wireless Toolkit or Android SDK.|
|Hecl uses the Apache Ant build system, so you need to install that as well to compile Hecl. If you are on Windows, this may require a bit of extra work. Here are some instructions for setting up Ant on Windows.|
To compile the standard, J2SE version of Hecl, do this:
You should now have a Hecl.jar file in the
jars/j2se/ directory. To run it, do
java -jar jars/j2se/Hecl.jar hecl> puts "hello world" hello world
If you want to check your installation of Hecl, you can run the test suite to make sure everything checks out:
java -jar jars/j2se/Hecl.jar tests/suite.hcl
An (incomplete) performance test is also supplied so that you can compare numbers if you're curious, or want to hack on Hecl to improve its speed:
java -jar jars/j2se/Hecl.jar tests/performance.hcl
If you're going to be recompiling (you don't need to recompile if you're only going to be writing scripts, though!) Hecl for Java ME, you also need to follow these instructions.
You'll need to download and install Sun's "Java Wireless Toolkit", here: http://java.sun.com/products/sjwtoolkit/index.jsp.
You also need to make Hecl aware of the WTK. For instance, in my installation, the
settings.xml file has the following:
<!-- General WTK settings --> <!-- make it fit for your local installation --> <property name="my.wtk.home" value="/opt/WTK2.5.2"/>
You would need to change
/opt/WTK25.2 to wherever the WTK is
located on your system.
See the section called “Hecl and Java ME” for further information on installation and use with J2ME.
Even if you're not interested in recompiling Hecl to hack on the source code, to write Hecl scripts, you need some kind of editor for programming. Hecl is close enough in syntax to the Tcl programming language that editors that support Tcl work well with Hecl.
Emacs' Tcl mode is easy to use:
tcl-mode, or if you want to associate
.hcl scripts with
tcl-mode, add this to your
(setq auto-mode-alist (cons '("\\.hcl$" . tcl-mode) auto-mode-alist))
Eclipse is popular for working on Java projects. It also has a Tcl mode that can be utilized for Hecl scripts like so:
Editing Hecl scripts with Eclipse
Install the DLTK from the following URL: http://download.eclipse.org/technology/dltk/updates, from within Eclipse.
After downloading you must associate the
*.hcl files with the Tcl Source Editor.
→ → → →
Than make a new file type by adding the
*.hcl file type, and
select the Tcl Source Editor.