armedbear / abcl

Armed Bear Common Lisp <git+https://github.com/armedbear/abcl/> <--> <svn+https://abcl.org/svn> Bridge
https://abcl.org#rdfs:seeAlso<https://gitlab.common-lisp.net/abcl/abcl>
Other
288 stars 29 forks source link

Respect `JAVA_HOME` inside start up script #649

Open catap opened 8 months ago

catap commented 8 months ago

This is quite usual for Java application to use JVM which is defined via JAVA_HOME environment variable.

Unfortently, abcl caches the used java at compiling time, which may lead to broken abcl when JDK is updated.

Shall it respect JAVA_HOME and simple run java by default instead like it does maven and all other projects?

easye commented 8 months ago

The hard-coding of the JDK used in the compilation for the abcl/abcl.bat wrapper scripts was a deliberate choice for simplicity of implementation.

Background

Offer

All that being said, if someone were to provide patches for Unix Bash/MS-DOS implementation that was more sophisticated, I would seriously consider including it. Bonus points if one has a single base template that "(com/trans)piles into" Bash/MS-DOS scripts.

cooljeanius commented 6 months ago

So I'm coming here from macports/macports-ports#21762 to mention that this is indirectly preventing me from upgrading abcl in MacPorts, btw... hardcoding the JDK means that the port has to use OpenJDK21, which fails to build for me currently due to: https://trac.macports.org/ticket/69440

alanruttenberg commented 6 months ago

I have a more sophisticated launcher but it is partially out of date and undocumented. Still, if it looks useful I will consider putting some time into it if there are opinions about what the functionality should be: https://github.com/alanruttenberg/lsw2/blob/owlapiv4/bin/abcl Among other things it just calls plain java, which should respect JAVA_HOME, but that can also be overridden by providing ABCL_JAVA environment variable.

catap commented 6 months ago

On Mon, 04 Mar 2024 02:56:23 +0100, Alan Ruttenberg wrote:

I have a more sophisticated launcher but it is partially out of date and undocumented. Still, if it looks useful I will consider putting some time into it if there are opinions about what the functionality should be: https://github.com/alanruttenberg/lsw2/blob/owlapiv4/bin/abcl Among other things it just calls plain java, which should respect JAVA_HOME, but that can also be overridden by providing ABCL_JAVA environment variable.

What a nice and huge job which may help, indeed.

Anyway, you have an assumption that java binary is available inside PATH and it isn't true for some system.

As far as I know only macOS has java wrapper inside PATH.

-- wbr, Kirill

easye commented 6 months ago

Just to emphasize: I'm happy to accept patches for this functionality, but we would need to have equivalent (and tested) functionality under Windows which is what makes this more difficult than it should be.

I use https://github.com/jenv/jenv to manage my Java runtimes. Maybe it has a Windows equivalent?

alanruttenberg commented 6 months ago

I'm afraid I don't know anything about running in a windows environment or how to drive any of the windows shells.