Lisp HUG Maillist Archive

LispWorks Java and MacOS

I am running LispWorks 7.1 on MacOS 10.11.6. 
I am trying to initialize the java interface with (init-java-interface :jvm-library-path t) , but I get an error saying that I need to use the legacy version 6 of Java. Following this message, LispWorks exits. 
I have Java 8 Update 161 installed.  

What do I need to do?
- Pass some parameters to init-java-interface to allow for the current Java version to be used?
- Backtrack to Java 6?
- Other options?

Thanks

Bruno


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

Re: LispWorks Java and MacOS

(defparameter *jdk8-library-path*
  "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/server/libjvm.dylib")

(defun load-java8 (&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))))

> Il giorno 22 gen 2018, alle ore 21:01, Bruno Emond <emond.bruno@gmail.com> ha scritto:
> 
> I am running LispWorks 7.1 on MacOS 10.11.6.
> I am trying to initialize the java interface with (init-java-interface :jvm-library-path t) , but I get an error saying that I need to use the legacy version 6 of Java. Following this message, LispWorks exits.
> I have Java 8 Update 161 installed.
> 
> What do I need to do?
> - Pass some parameters to init-java-interface to allow for the current Java version to be used?
> - Backtrack to Java 6?
> - Other options?
> 
> Thanks
> 
> Bruno
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


Re: LispWorks Java and MacOS

After the initial success, I slowed down very quickly. 
I am not very familiar with Java, so I am facing a steep learning curve. 
So most of what follows might be a very basic set of questions. 

I want to interface with ActiveMQ. I built a STOMP producer/customer a couple of years ago, and ti was easy, but I need this time to use openwire. I looked at the openwire specs, and would rather use something that already works, such as the Java JMS and org.apache.ActiveMQ. 

I downloaded the last version of the Java SE SDK (9.0.4), and realized that the JMS seems to be part of EE. As far as I can see, EE does not  come with a VM. 

So here is a set of naive questions:
- After initializing the VM with init-java-interface, are we limited to the classes already defined in the VM (using import-java-class-definitions) ?
- Is there a way to load jar files in the initialized VM using lisp?

Bruno

 

> On Jan 22, 2018, at 17:18, Bruno Emond <emond.bruno@gmail.com> wrote:
> 
> Success!
> Thank you Chun. 
> Bruno
> 
>> On Jan 22, 2018, at 16:40, Chun Tian <binghe.lisp@gmail.com> wrote:
>> 
>> (defparameter *jdk8-library-path*
>> "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/server/libjvm.dylib")
>> 
>> (defun load-java8 (&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))))
>> 
>>> Il giorno 22 gen 2018, alle ore 21:01, Bruno Emond <emond.bruno@gmail.com> ha scritto:
>>> 
>>> I am running LispWorks 7.1 on MacOS 10.11.6.
>>> I am trying to initialize the java interface with (init-java-interface :jvm-library-path t) , but I get an error saying that I need to use the legacy version 6 of Java. Following this message, LispWorks exits.
>>> I have Java 8 Update 161 installed.
>>> 
>>> What do I need to do?
>>> - Pass some parameters to init-java-interface to allow for the current Java version to be used?
>>> - Backtrack to Java 6?
>>> - Other options?
>>> 
>>> Thanks
>>> 
>>> Bruno
>>> 
>>> 
>>> _______________________________________________
>>> 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: LispWorks Java and MacOS

EE is a big spec implemented by application servers (such as WildFly). If you only want JMS, pick an implementation (such as ActiveMQ) and use it without caring about EE.

I don't know the LispWorks interface to Java, but I see a :java-class-path parameter: that's where you can place additional libraries (jar files) to be picked up by the JVM. Expect a bit of pain with the dependencies because nowadays projects use automatic dependency resolution (similar to ASDF + Quicklisp), nobody manually downloads jars anymore, and projects are structured keeping that into account (read: lots of tiny and not so tiny dependencies).

On 24 January 2018 at 01:56, Bruno Emond <emond.bruno@gmail.com> wrote:
After the initial success, I slowed down very quickly.
I am not very familiar with Java, so I am facing a steep learning curve.
So most of what follows might be a very basic set of questions.

I want to interface with ActiveMQ. I built a STOMP producer/customer a couple of years ago, and ti was easy, but I need this time to use openwire. I looked at the openwire specs, and would rather use something that already works, such as the Java JMS and org.apache.ActiveMQ.

I downloaded the last version of the Java SE SDK (9.0.4), and realized that the JMS seems to be part of EE. As far as I can see, EE does not  come with a VM.

So here is a set of naive questions:
- After initializing the VM with init-java-interface, are we limited to the classes already defined in the VM (using import-java-class-definitions) ?
- Is there a way to load jar files in the initialized VM using lisp?

Bruno



> On Jan 22, 2018, at 17:18, Bruno Emond <emond.bruno@gmail.com> wrote:
>
> Success!
> Thank you Chun.
> Bruno
>
>> On Jan 22, 2018, at 16:40, Chun Tian <binghe.lisp@gmail.com> wrote:
>>
>> (defparameter *jdk8-library-path*
>> "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/server/libjvm.dylib")
>>
>> (defun load-java8 (&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))))
>>
>>> Il giorno 22 gen 2018, alle ore 21:01, Bruno Emond <emond.bruno@gmail.com> ha scritto:
>>>
>>> I am running LispWorks 7.1 on MacOS 10.11.6.
>>> I am trying to initialize the java interface with (init-java-interface :jvm-library-path t) , but I get an error saying that I need to use the legacy version 6 of Java. Following this message, LispWorks exits.
>>> I have Java 8 Update 161 installed.
>>>
>>> What do I need to do?
>>> - Pass some parameters to init-java-interface to allow for the current Java version to be used?
>>> - Backtrack to Java 6?
>>> - Other options?
>>>
>>> Thanks
>>>
>>> Bruno
>>>
>>>
>>> _______________________________________________
>>> 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: LispWorks Java and MacOS

The -classpath argument to the JVM is a list of directories (of .class files) and/or .jar files and/or wildcard directory entries (e.g. foo/*) containing jar files. The list is separated by a system-dependent character, which is ':' on *nix and ';' on Windows.

I'm not sure if all of that applies to a JVM which is not instantiated through its "java" command, but looking at that (format nil "~S:~S" lispcalls class-paths) in your code I'm pretty sure class-paths can be something like "lib/foo.jar:lib/bar.jar:..."

On 24 January 2018 at 14:43, Bruno Emond <emond.bruno@gmail.com> wrote:
Thanks Alessio,

As far as I know, and again I am new to the Java lisp integration, the :java-class-path points to "etc/lispcalls.jar”, which is used for Java to Lisp calls.

I do not know if it is possible to point to a directory of jar files for searching classes, and I do not think that the :jin-env-finder parameter is what is needed.

Bruno


> On Jan 24, 2018, at 04:34, Alessio Stalla <alessiostalla@gmail.com> wrote:
>
> EE is a big spec implemented by application servers (such as WildFly). If you only want JMS, pick an implementation (such as ActiveMQ) and use it without caring about EE.
>
> I don't know the LispWorks interface to Java, but I see a :java-class-path parameter: that's where you can place additional libraries (jar files) to be picked up by the JVM. Expect a bit of pain with the dependencies because nowadays projects use automatic dependency resolution (similar to ASDF + Quicklisp), nobody manually downloads jars anymore, and projects are structured keeping that into account (read: lots of tiny and not so tiny dependencies).
>
> On 24 January 2018 at 01:56, Bruno Emond <emond.bruno@gmail.com> wrote:
> After the initial success, I slowed down very quickly.
> I am not very familiar with Java, so I am facing a steep learning curve.
> So most of what follows might be a very basic set of questions.
>
> I want to interface with ActiveMQ. I built a STOMP producer/customer a couple of years ago, and ti was easy, but I need this time to use openwire.. I looked at the openwire specs, and would rather use something that already works, such as the Java JMS and org.apache.ActiveMQ.
>
> I downloaded the last version of the Java SE SDK (9.0.4), and realized that the JMS seems to be part of EE. As far as I can see, EE does not  come with a VM.
>
> So here is a set of naive questions:
> - After initializing the VM with init-java-interface, are we limited to the classes already defined in the VM (using import-java-class-definitions) ?
> - Is there a way to load jar files in the initialized VM using lisp?
>
> Bruno
>
>
>
> > On Jan 22, 2018, at 17:18, Bruno Emond <emond.bruno@gmail.com> wrote:
> >
> > Success!
> > Thank you Chun.
> > Bruno
> >
> >> On Jan 22, 2018, at 16:40, Chun Tian <binghe.lisp@gmail.com> wrote:
> >>
> >> (defparameter *jdk8-library-path*
> >> "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/server/libjvm.dylib")
> >>
> >> (defun load-java8 (&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))))
> >>
> >>> Il giorno 22 gen 2018, alle ore 21:01, Bruno Emond <emond.bruno@gmail.com> ha scritto:
> >>>
> >>> I am running LispWorks 7.1 on MacOS 10.11.6.
> >>> I am trying to initialize the java interface with (init-java-interface :jvm-library-path t) , but I get an error saying that I need to use the legacy version 6 of Java. Following this message, LispWorks exits.
> >>> I have Java 8 Update 161 installed.
> >>>
> >>> What do I need to do?
> >>> - Pass some parameters to init-java-interface to allow for the current Java version to be used?
> >>> - Backtrack to Java 6?
> >>> - Other options?
> >>>
> >>> Thanks
> >>>
> >>> Bruno
> >>>
> >>>
> >>> _______________________________________________
> >>> 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
>


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