| allegro-cl archives 2002-5-2 | home index prev H thread prev K thread next J next L |
|
From: nura nura Subject: Date: 2002-5-2 12:52
hello i got problem with jlinker....is there other example beside in jlinker.html....and in acl6.0?one more thing i am using jlinker for my thesis on scheduling university...using java and lisp....below is jlinker configuration in file jl-config.cl...i dont understand what the comment ask me to do....so if u guys know something..tell me how to run the example of jlinker in acl6.0
;; $Id: jl-config.cl,v 1.6.2.7 2000/10/24 04:04:28 layer Exp $(in-package :user);; SAMPLE FILE with DUMMY values to be customized for each site(error "This file must be renamed and customized before it can be used")(setf jl-here (read-from-string
(concatenate
'string ":" (string-downcase (short-site-name)))));; ??? marks places that MUST be customized;; the following variables have default values that may be changed
;; to suit special situations (such as heavy debugging)
;;(setf javatools.jlinker:*jlinker-verbose* t)
;;(setf javatools.jlinker:*jlinker-debug* t)
;;(setf javatools.jlinker:*jlinker-retry-number* 3)
;;(setf javatools.jlinker:*jlinker-retry-delay* 5);; In general, this is a good idea because it avoids user
;; shell profiles when we call Java (after setting up path
;; and CLASSPATH).
(setf javatools.jlinker:*jlinker-unix-vector-p* t)
;; The value of the two variable below is significant ONLY if Lisp
;; will start Java with (jlinker-init :start-java ...)
;; Expected value of this symbol:
;; symbol -> The name of a function of at least five (5) optional arguments.
;; The default value shown below is a function included
;; with jLinker. This value can also be replaced with
;; the name of a suitable user-written function.
;; other -> Error
(setf javatools.jlinker:*jlinker-run-java* 'javatools.jlinker::run-java)
;; Expected value of this symbol:
;; string -> Path namestring of Java home directory
;; jLinker will construct a suitable value for PATH
;; and for CLASSPATH
;;
;; nil -> jLinker makes no modifications to PATH or CLASSPATH
;; User must make sure that the file jlinker.jar is
;; visible to Java.
(setf javatools.jlinker:*jlinker-java-home*
(case jl-here
(:ketch "c:\\mmWork\\java\\jdk1.2")
(:lifeboat "d:\\java\\jdk1.2")
(:hobart "c:\\jdk1.3")
;;(:lifeboat "e:\\java\\jdk1.1.5")
(:five "/oh/java1.1")
(:corba "/b/jdk1.1.6")
(:spot "/usr/j2se")
(:cobweb "/usr/java/jdk1.3")
(:delta "")
(otherwise "")
)
)
;; The code for javatools.jlinker::run-java is included below as a
;; sample that can be renamed and modified to satisfy the
;; requirements of a particular installation.
#|
(defun run-java (&optional debug lport lhost jport jhost &rest more)
(let* ((op-val #+unix "java"
#+mswindows
(if debug "cmd /c start /wait /b java.exe" "javaw.exe")
)
(class javatools.jlinker::*java-link-base-class*)
(cmdl (append (list op-val class)
(when lport (list "-lport" (format nil "~A" lport)))
(when lhost (list "-lhost" lhost))
(when jport (list "-jport" (format nil "~A" jport)))
(when jhost (list "-jhost" jhost))
(when debug (list "-debug"))
(mapcar #'(lambda (m) (format nil "~A" m)) more)
))
(command
#+mswindows (format nil "~{~A ~}" cmdl)
#+unix
(if *jlinker-unix-vector-p*
(make-array (1+ (length cmdl))
:initial-contents (cons (car cmdl) cmdl))
(format nil "~{~A ~}" cmdl))
)
(log
#+mswindows (and debug (jlinker-slot :java-out)
(concatenate
'string (jlinker-slot :java-out) ".log"))
#+unix nil
)
(elog (when log
(concatenate 'string (jlinker-slot :java-out) "e.log")))
(show (if (and debug (null log)) :showna :hide))
)
(set-java-paths)
(when log (jlinker-slot :java-out :wrap))
(jcollect-pid
command
:output log
:if-output-exists :supersede
:error-output elog
:if-error-output-exists :supersede
:show-window show
:wait nil)))(defun jcollect-pid (&rest args)
(multiple-value-bind (rc x pid)
(apply #'run-shell-command args)
(declare (ignore x))
(if pid
(jlinker-slot :pid pid)
rc)))(defun set-java-paths ()
(let* ((delim #+mswindows "\\" #+unix "/")
(break #+mswindows ";" #+unix ":")
(jhome *jlinker-java-home*)
class oldcp
path)
(when (and jhome (file-directory-p jhome))
(when (equal jhome "") (setf jhome "."))
(setf (sys:getenv "JAVA_HOME") jhome)
(setf class (sys:getenv "CLASSPATH"))
(if (or (null class) (equal class ""))
(setf class "")
(setf class (concatenate 'string class break)))
(or (and (setf oldcp (sys:getenv "CLASSPATH"))
(search "jlinker.jar" oldcp))
(setf (sys:getenv "CLASSPATH")
(apply #'concatenate 'string
class "." delim break
"jlinker.jar" break
jhome delim "lib"
(when oldcp (list break oldcp))
)))
(or (and (setf path (sys:getenv "PATH"))
(search jhome path))
(setf (sys:getenv "PATH")
(concatenate 'string jhome delim "bin" break path))))))
|#
---------------------------------
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
|