Last change
on this file since 15577 was
12908,
checked in by vvoutilainen, 13 years ago
|
Add an example for using a java class with CLASSPATH, invoking java
functions from lisp code and finding the java class automagically
as it's in CLASSPATH.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[12908] | 1 | ABCL Examples Building and Running Instructions |
---|
| 2 | =============================================== |
---|
| 3 | |
---|
| 4 | To compile |
---|
| 5 | |
---|
| 6 | cmd$ javac -cp ../../dist/abcl.jar Main.java |
---|
| 7 | |
---|
| 8 | where the "../../../dist/abcl.jar" represents the path to your |
---|
| 9 | abcl.jar file, which is built via the Ant based build. This path |
---|
| 10 | could be slightly different depending on how the system was |
---|
| 11 | constructed, and possibly due to operating system conventions for |
---|
| 12 | specifying relative paths. However you resolve this locally, we'll |
---|
| 13 | refer to this as '$ABCL_ROOT/dist/abcl.jar' for the rest of these |
---|
| 14 | instructions. |
---|
| 15 | |
---|
| 16 | This compiles the Java source file "Main.java" into a JVM runtime or |
---|
| 17 | class file named "Main.class". |
---|
| 18 | |
---|
| 19 | To run the example (Main.class for example) from a Unix-like OS use: |
---|
| 20 | |
---|
| 21 | cmd$ export CLASSPATH=. |
---|
| 22 | cmd$ $ABCL_ROOT/abcl |
---|
| 23 | |
---|
| 24 | then, in abcl repl, use: |
---|
| 25 | (load "lispfunctions") |
---|
| 26 | (void-function) |
---|
| 27 | |
---|
| 28 | or in Windows use: |
---|
| 29 | |
---|
| 30 | cmd$ set CLASSPATH=. |
---|
| 31 | cmd$ $ABCL_ROOT/abcl |
---|
| 32 | |
---|
| 33 | then, in abcl repl, use: |
---|
| 34 | (load "lispfunctions") |
---|
| 35 | (void-function) |
---|
| 36 | |
---|
| 37 | This will result in the Main class being found from the CLASSPATH, and you |
---|
| 38 | can invoke the functions of the Main class from lisp code. |
---|
Note: See
TracBrowser
for help on using the repository browser.