Lisp HUG Maillist Archive

Running Java Interface on macOS Sierra

Hello,

I would like to use the Java 8 installed on my system, how do I initialize the Java Interface?

I tried specifying the location of the libjvm.dylib as the :jvm-library-path argument, but it does not change the problem : LispWork brutally quits and a dialog is displayed saying that I should install the legacy Java SE 6. Something like this: https://java.com/en/download/faq/yosemite_java.xml
< br class="">

Best,
Cam

Re: Running Java Interface on macOS Sierra

Unable to parse email body. Email id is 14260

Re: Running Java Interface on macOS Sierra

Hi Martin,

It works, thanks!

I upgraded the installed JVM capabilities, and then:

  (require "java-interface")
  (lw-ji:init-java-interface :jvm-library-path "/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/jre/lib/server/libjvm.dylib")


Merely using t as the :jvm-library-path argument was not enough.


Best,
Cam



> On 24 Feb 2017, at 13:32, Martin Simmons <martin@lispworks.com> wrote:
> 
>>>>>> On Wed, 22 Feb 2017 23:38:40 +0100, Camille Troillard said:
>> 
>> 
>> Hello,
>> 
>> I would like to use the Java 8 installed on my system, how do I initialize the Java Interface?
>> 
>> I tried specifying the location of the libjvm.dylib as the :jvm-library-path argument, but it does not change the problem : LispWork brutally quits and a dialog is displayed saying that I should install the legacy Java SE 6. Something like this: https://java.com/en/download/faq/yosemite_java.xml <https://java.com/en/download/faq/yosemite_java.xml>
> 
> Maybe this will help (untested)?
> 
> https://forums.developer.apple.com/thread/3718
> 
> or
> 
> https://derflounder.wordpress.com/2015/08/08/modifying-oracles-java-sdk-to-run-java-applications-on-os-x/
> 
> -- 
> Martin Simmons
> LispWorks Ltd
> http://www.lispworks.com/
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Running Java Interface on macOS Sierra

That's great, thanks for the tip!


> On Feb 24, 2017, at 17:28, Chun Tian (binghe) <binghe.lisp@gmail.com> wrote:
> 
> I have the following scripts in my ~/.lispworks file (shared with old LW versions):
> 
> #+lispworks7
> (progn
> 
> (require "java-interface")
> 
> (defparameter *jdk8-library-path*
>  "/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/server/libjvm.dylib")
> 
> (defun initialize-jdk8 (&optional class-paths)
>  (let ((lispcalls (namestring (lispworks-file "etc/lispcalls.jar"))))
>    (funcall
>      (intern "INIT-JAVA-INTERFACE" "LW-JI")
>      :jvm-library-path *jdk8-library-path*
>      :java-class-path (if class-paths
> 			   (format nil "~S:~S" lispcalls class-paths)
>                           lispcalls))))
> 
> ) ; progn
> 
> This gives an easy way to load more JARs other than the default lispcalls.jar.
> 
> Hope this helps,
> 
> Chun


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:31 UTC