Q 4.11-1) Why does a call to jlinker-init with a non-nil value for debug fail? (I am running Windows 98.)
A 4.11-2) jlinker-init calls javatools.jlinker::run-java, the source for which is shown in the file [Allegro Directory]/jlinker/jl-config.cl. The definition for that function contains the line:
(if debug "cmd /c start /wait /b java.exe" "javaw.exe")
so if the debug is true, a call is made to cmd. However, cmd is not defined on Windows 95/98. Instead command.com is defined, and the line in the definition of javatools.jlinker::run-java should be
(if debug "command.com /c start /wait /b java.exe" "javaw.exe")
There seems to be no reliable way to determine at run-time the actual version of the Windows Operating System being run, nor whether cmd or command.com is the correct command to use. If you are running Windows 95/98, you can edit jl-config.cl to use command.com rather than cmd with the following three steps. Then the next time you use Allegro CL, the revised definition of will be used and you can call jlinker-init with debug true.
(in-package :javatools.jlinker)
(defun run-java (&optional debug lport lhost jport jhost &rest more)
(let* ((op-val #+unix "java"
#+mswindows
;; replaced cmd with command.com in next line so it runs on
;; Windows 95/98:
(if debug "command.com /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)))
Previous FAQ topic: 4.10 AllegroStore
First FAQ topic: 1.1. ACL current version info
© Copyright 2000, 2002, 2004, Franz Inc., Berkeley, CA. All rights reserved.
$Revision: 1.2 $