Lisp filepath issues when running application directly from jar file

Mark Evenson evenson at panix.com
Sat Aug 15 07:28:11 UTC 2015


> On Aug 14, 2015, at 12:20, Hamda Binte Ajmal <hamda.binte.ajmal at gmail.com> wrote:
> 
> Hi,
> I was working on an application, that loads a few lisp files using lisp command
> (load "fullfilepath.lisp") from java using ABCL.
> This file in turn loads the other lisp files located in same folder hierarchy, and then i call lisp functions (defined in these files) from java and everything works perfect as long as I run the application from Netbeans.
> Close to deployment, I tested the application by running it from jar file, I found that there are issues with filepaths, as the files are not a part of file-system, and hence not accessible using a file-path.
> Does anyone has any idea how to fix this issue ?

ABCL has [extended the semantics of Lisp PATHNAME objects to be able to refer
to files within jar files][1].

[1]:
http://abcl.org/trac/browser/trunk/abcl/doc/design/pathnames/jar-pathnames.markdown

If you know the absolute path of the jar file locally, you may specify a file
within via something that looks like:
“jar:file:/absolute/path/to/file.jar!/path/within/jar/setup.lisp”.  See the
above referenced design specification for more details.

The [ASDF-JAR contrib][2] provides a convenient mechanism for packaging Common
Lisp systems encapsulated by ASDF into a jar that may subsequently used as the
basis for loading these systems via the ASDF-JAR:ADD-TO-ASDF function.

[2]: http://abcl.org/trac/browser/trunk/abcl/contrib/asdf-jar/README.markdown

Both these options require that you know the absolute path of the deployed jar.
JAR-PATHNAME objects follow CL:MERGE-PATHNAME conventions, so one may be able
to figure out runtime locations based on the user home directory.

[…]

Please let me know if I can be of further assistance here.  


-- 
"A screaming comes across the sky.  It has happened before but there is nothing 
to compare to it now."





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20150815/b685b7c9/attachment.html>


More information about the armedbear-devel mailing list