This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: swank-kawa.scm


sorry add one more function

(define (get-os-name)
  (invoke (<java.lang.System>:getProperty "os.name") 'toLowerCase))

On Mon, Apr 22, 2013 at 9:34 PM, Chuah Teong Leong <teongleong@gmail.com> wrote:
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]