I've made progress in this and have gotten the pl2java example to run on Windows. The story is interesting and I'm relaying it to the list as it may save someone time.
(BTW: I'm now doing this on a Windows 2000 sp1 machine with jdk1.3)
To get around the problem (see earlier message) of absolute_file_name producing a path that is unsuitable for use as a -classpath argument to java, I crudely hardcoded in javart.pl compound_classpath("e:/prolog/ciao-1.7p30Win32/library/javall"). certainly not a long term solution, but enough to work around the issue for now.
The next problem I encountered was the that java process wasn't actually getting started. In an attempt to determine the cause, I decided to build ciao from it's source, so that I could examine things in the prolog_unix_popen function within the engine\streams.c file.
In order to build Ciao, I needed to bring over a fresh version (1.1.7) of the GNU tools from www.cygwin.com. The build broke during compilation of engine\streams.c due to an undefined reference to sys_errlist in the function ENG_perror. I rewrote the function to not use sys_errlist, and I got the ciaoengine to build.
[BTW: The next thing in the make, building the ciao compiler failed with the message E:/prolog/ciaosrc/ciao-1.7p30/bin/Win32i86/ciaoengine: should be in the standard location, under Win32/bin/make[1]: *** [compiler] Error 1 That file was there, but all I was really concerned about was building the ciaoengine, so I didn't pursue the cause of this error.]
I copied the newly built engine to its install location, and found that there was some sort of version (entry point) mismatch between it, and the cygwin1.dll (created in December 1998) that ships with the binary distribution of ciao. So, I copied the new 1.1.7 cygwin1.dll in its place, and unbelievably, everything now worked. Strange -- very strange. My best guess is a change in the win32 api behavior between December 98 and now.
-- Dan
-----Original Message----- From: Larner, Dan <larner(a)parc.xerox.com> [mailto:larner(a)parc.xerox.com] Sent: Friday, December 29, 2000 4:40 PM To: 'ciao-users(a)clip.dia.fi.upm.es' Cc: Larner, Dan <larner(a)parc.xerox.com> Subject: pl2java on Windows?
Hi,
I'm trying to get the library/javaall/Examples/pl2java example to work. I'm using Ciao-1.7p30 with the Javasoft JDK 1.2.2 on a Windows NT sp5 machine.
When I run the example, I get sh access violations. It turns out that (in javart.pl) when a java_connection is trying to be established, an attempt is made to start java with the command line:
java -classpath //C/prolog/ciao-1.7p30Win32/library/javall CiaoJava.PLJavaServer
which doesn't work properly because the classpath string is ill formed.
[Note: In a comand window I can enter the line java -classpath C:/prolog/ciao-1.7p30Win32/library/javall CiaoJava.PLJavaServer and the server does start up correctly. ]
It is being produced by compound_classpath's use of absolute_file_name(library('javall/javart'),AbsFileName),
Anyone have any hints as to how to get this to work properly on Windows?
-- Dan