This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: swank-kawa.scm
- From: Chuah Teong Leong <teongleong at gmail dot com>
- To: Helmut Eller <eller dot helmut at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Mon, 22 Apr 2013 21:34:39 +0800
- Subject: Re: swank-kawa.scm
- References: <CAHxu6d9TsvJ3ofdtsY01y6RmC+dDHrLL0e422ZpzY4sE4b1K7w at mail dot gmail dot com> <m2obd7agab dot fsf at gmail dot com> <CAHxu6d8UeGcq8f_8oVBRUsg5nTeGKFrcnTnrZoXjN-=RjzbAeg at mail dot gmail dot com> <m2vc7fq8mm dot fsf at gmail dot com> <CAHxu6d9qiCr=4diJCJBeBN8bY+29Lz83Qqyj+Oke4hVXRfU3fw at mail dot gmail dot com>
I spelt libarary wrongly there.
I installed the 32 bit version of jdk and added
-Djava.library.path to the 32 bit jdk's bin
It runs fine. from within emacs
M-- M-x slime RET kawa
runs it fine now.
I think it is worth adding
"-Djava.library.path=C:/Program Files (x86)/Java/jdk1.7.0_21/jre/bin"
to the readme on top
below is the code that hopefully get it working on both windows and unix systems
;;=========================================================================
;; checking OS type
(define (is-windows?)
(invoke (as <java.lang.String> (get-os-name)) 'startsWith "windows"))
(define (is-linux-os?)
(invoke (as <java.lang.String> (get-os-name)) 'startsWith "linux"))
(define (is-mac-os?)
(invoke (as <java.lang.String> (get-os-name)) 'startsWith "mac os x"))
(df getpid()
(df get-windows-pid ()
(df filter-numbers (str) ;; extracts the number portion of the str
(define pattern (invoke-static <java.util.regex.Pattern> 'compile "[0-9]+"))
(define matcher (invoke pattern 'matcher str))
(invoke matcher 'find)
(define found (invoke matcher 'group))
(display "found ")(display found)(newline)
(invoke-static <java.lang.Integer> 'parse-int found))
(let* ((name (! get-name (invoke-static
<java.lang.management.ManagementFactory> 'get-runtime-mX-bean)))
(pid (filter-numbers name)))
;(display "PID ")(display name)(newline)
;(display pid)(newline)
pid
))
(df get-unix-pid ()
(let ((p (make-process (command-parse "echo $PPID") #!null)))
(! waitFor p)
(! read-line (<java.io.BufferedReader> (<in> (! get-input-stream p))))))
(cond ((is-windows?) (get-windows-pid))
((or (is-linux-os?) (is-mac-os?)) (get-unix-pid)))
)
;;================================================================
On Mon, Apr 22, 2013 at 5:06 PM, Chuah Teong Leong <teongleong@gmail.com> wrote:
> '((kawa ("java"
> "-Xss450k" ; compiler needs more stack
> "-cp" "C:/kawa/kawa-1.13.1-7491.jar;C:/Program
> Files/Java/jdk1.7.0_15/lib/tools.jar;"
> "-Djava.libarary.path=C:/Program
> Files/Java/jdk1.7.0_15/jre/bin/attach.dll" ;; <============= added
> this
> "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n"
> "kawa.repl" "-s")
>
> still the same. not sure what is wrong now.
>
> On Mon, Apr 22, 2013 at 4:20 PM, Helmut Eller <eller.helmut@gmail.com> wrote:
>> On Mon, Apr 22 2013, Chuah Teong Leong wrote:
>>
>>> seems like the pid is getting passed in now, however I still get the
>>> same error message.
>>>
>>> not sure what this is trying to say
>>> java.util.ServiceConfigurationError:
>>> com.sun.tools.attach.spi.AttachProvider: Provider
>>> sun.tools.attach.WindowsAttachProvider could not be instantiated:
>>> java.lang.UnsatisfiedLinkError: no attach in java.library.path
>>
>> Maybe adding -Djava.library.path would help:
>> http://osdir.com/ml/clojure/2011-12/msg00267.html
>>
>> Helmut