Java classpath for Cal calling?

2 views
Skip to first unread message

Steve Harris

unread,
Sep 11, 2007, 5:31:10 PM9/11/07
to CAL Language Discussion
If I were wanting to access Cal code from Java, what is the minimum I
would need to add to my Java classpath? Would a car-jar file
generated for just a given workspace and it's dependencies be enough
to call the included Cal functions, using either the high-level Gem
style api or the lower level "source-model" api? I didn't see any
mention in "Java Meets Quark" about what is required on the classpath
(though I may have missed it). I noticed the samples are just using
the expanded Quark bin directory directly - would I need to jar this
up for delivery with my app?

Steve

Joseph Wong

unread,
Sep 11, 2007, 7:36:17 PM9/11/07
to cal_la...@googlegroups.com
Hi Steve,

Thanks for the question. To run CAL code from Java, you will need the
following Quark Platform JARs on your classpath:

- Quark/bin/java/release/calUtilities.jar
- Quark/bin/java/release/calPlatform.jar
- Quark/bin/java/release/calLibraries.jar
- Quark/bin/java/release/quarkGems.jar
(this is needed if you use the high-level Gem API)
- all JARs in Quark/lib/Resources/External/java/
(icu4j.jar, log4j.jar, antlr.jar, asm-all-3.0.jar,
commons-collections-3.1.jar, xercesImpl.jar,
xmlParserAPIs.jar, junit.jar)

In addition, you will need the Car-jar files and their external Java
dependencies.

If you are deploying the Gem Cutter tool as well, you will also need:
- Quark/bin/java/release/quarkGems.jar
(if not already included from the list above)
- Quark/lib/Resources/GemCutterHelpFiles.jar
- Quark/lib/Resources/External/Sun/JavaHelp/2.0_02/jh.jar

If you are deploying an application written in CAL, and do not require
metaprogramming facilities (e.g. running pieces of CAL expressions from
within Java, adding new modules at runtime, querying for functions
matching a particular type), you may want to consider using "standalone
JARs" as an alternative deployment mechanism. It allows you to package
up a CAL function of the type ([String] -> ()) into a JAR that includes
only the classes necessary for running the function. This approach is
described in more detail in the "Using Quark with Standalone JARs"
document.

If deploying with standalone JARs, the required set of core Quark
Platform JARs is smaller:

- Quark/bin/java/release/calUtilities.jar
- Quark/bin/java/release/calPlatform.jar
- Quark/bin/java/release/calLibraries.jar
- Quark/lib/Resources/External/java/icu4j.jar
- Quark/lib/Resources/External/java/log4j.jar
- the generated standalone JAR, and its external Java dependencies

To assist in building up this classpath, the Open Quark distribution
includes a quarklaunch script that makes it easy to run an application
packaged as a standalone JAR (documentation for the script is included
in the "Using Quark with Standalone JARs" document).


Hope this helps! :)

Joseph

Joseph

unread,
Sep 11, 2007, 7:58:57 PM9/11/07
to CAL Language Discussion
The "Using Quark with Standalone JARs" document can be found here:
http://resources.businessobjects.com/labs/cal/using_standalone_jars.pdf

It is also included in the Open Quark platform binary and source
distributions.

Joseph

On Sep 11, 4:36 pm, "Joseph Wong" <Joseph.W...@businessobjects.com>
wrote:

Steve Harris

unread,
Sep 12, 2007, 9:40:46 AM9/12/07
to CAL Language Discussion
Joseph,
thanks, that's what I needed.
PS: maybe it could be added to "Java Meets Quark"?

Joseph Wong

unread,
Sep 12, 2007, 5:13:56 PM9/12/07
to cal_la...@googlegroups.com
Hi Steve,

Thanks for the suggestion. I've just updated "Java Meets Quark" with the
content from my previous reply, in a new section on deployment. The
updated document will be included in the next release.

Joseph

-----Original Message-----
From: cal_la...@googlegroups.com
[mailto:cal_la...@googlegroups.com] On Behalf Of Steve Harris
Sent: Wednesday, September 12, 2007 6:41 AM
To: CAL Language Discussion

Reply all
Reply to author
Forward
0 new messages