Jcont translates Icon source files into .zip files,
and links .zip files to make an executable program.
Jcont is similar to icont in concept and behavior;
think of a .zip file as analogous to a
.u1/.u2 pair generated by icont.
Normally, jcont produces a directly executable shell script containing an embedded Zip file. Running the script executes the compiled Icon program, and arguments can be passed as usual.
The short form jcon command is analogous to the icon command. It translates, links, and executes a single source file.
jcont[options] file... [-x[arguments]]
jconfile.icn[arguments]
file .icnIcon source file to compile and link file .zipPreviously compiled file to link
(Must be local: jcont does not search $IPATH for file.zip)file .classJava bytecode file (for dynamic loading) to include in output file
-bgenerate backwards-compatible .u1and.u2files; implies-c-ccompile only: don't produce an executable -Epreprocess only -f denable debugging features (tracing, error conversion) -hprint a usage message and exit -jproduce a .jarfile instead of an executable script-oexespecify output file for executable -rinclude a copy of the run-time system in the executable -ssilent: suppress commentary -tcompile with -f d(to allow tracing) and initialize&traceto -1-ulist undeclared variables -xexecute after compilation (appears after file arguments)
The following options are mainly for debugging Jcon:
-ddebug jcont: use ./jtmpfor temporary files, and do not delete them when finished-Juse Jcon-built versions of jtran and jlink, if available -Ppessimize: don't optimize the generated Java code -Salso generate a .jvmfile listing the generated Java code-vverbose: echo shell commands and trace linking steps
The following environment variables affect compilation and linking:
LPATHSearch path for $includedirectivesIPATHSearch path for linkdirectives
The following environment variables affect execution:
CLASSPATHSearch path for Java libraries required at execution time. This is not usually needed unless the libraries have moved. JXOPTSOptions passed to the Java interpreter that runs the program. Depending on the implementation, JXOPTS can select options such as profiling or run-time compilation to machine code. TRACEInitial value of the Icon keyword &trace. If set, it overrides compilation with-t.
If a Jcon program runs out of memory, Java's limits can be increased
by setting JXOPTS.
For example, setenv JXOPTS '-mx50m'
increases the maximum space to 50 megabytes.
See the Java documentation for other Java options.
If -j is passed to jcont,
the final output file is given a .jar extension
and the header is omitted to facilitate manipulation of the file as an archive.
Execution is accomplished by naming the file in the CLASSPATH,
along with the run-time library, and then running java:
jcont -j myprog.icn setenv CLASSPATH myprog.jar:/myhome/jcon/bin/jcon.zip java myprog
If the -r flag is also used, a copy of the run-time
library is included in the the generated jar file.
This provides a self-contained package that can be executed on any
Java implementation, possibly even one of different architecture:
jcont -jr myprog.icn java -jar myprog.jar
java must be in the search path,
and also javap if -S is used.
The -S option does not work for files containing
link directives.
A compiled .zip file cannot be renamed:
The file name must match the original .icn name.
(However, executables can be renamed.)