2024-11-23 21:35 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000108mercuryBugpublic2009-11-23 22:11
Reportergloomdemon 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000108: invalid java path with mercury and mingw
DescriptionMercury Compiler, version rotd-2009-09-15
mingw with gcc4.4 on windows vista

while compiling java grade, mercury compiler uses invalid path:
$ mmc --java -v --make family
...
% Invoking system command `/c/Java/jdk1.6.0_12/bin/javac -classpath :c:/mingw/me
rcury/lib/mercury/lib/java/mer_rt.jar:c:/mingw/mercury/lib/mercury/lib/java/mer_
std.jar:c:/mingw/mercury/lib/mercury/lib/java/mer_mdbcomp.jar:c:/mingw/mercury/l
ib/mercury/lib/java/mer_browser.jar:c:/mingw/mercury/lib/mercury/lib/java/mer_ss
db.jar -sourcepath Mercury\javas -d Mercury\classs -J-Xmx256m Mercury\javas\jmer
cury\family.java'...
...
Error: system command received signal 1.

,must be:

% Invoking system command `c:/Java/jdk1.6.0_12/bin/javac -classpath c:/mingw/...
with c:\ and no : after -classpath or dot before :

% Invoking system command `c:/Java/jdk1.6.0_12/bin/javac -classpath .:c:/mingw/...

=== ===

after compiling and linking created sh file incorrect.

#!/bin/sh
DIR=${0%/*}
CLASSPATH=$DIR/Mercury\classs:$CLASSPATH:c:/mingw/mercury/lib/mercury/lib/java/mer_rt.jar:c:/mingw/mercury/lib/mercury/lib/java/mer_std.jar:c:/mingw/mercury/lib/mercury/lib/java/mer_mdbcomp.jar:c:/mingw/mercury/lib/mercury/lib/java/mer_browser.jar:c:/mingw/mercury/lib/mercury/lib/java/mer_ssdb.jar
export CLASSPATH
JAVA=${JAVA:-/c/Windows/system32/java}
exec $JAVA jmercury.family "$@"

,must be:

CLASSPATH=$DIR/Mercury/classs:
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000191

wangp (developer)

Thanks for testing.

I thought javac on Windows needs ";" separators instead of ":", as colons are
use to denote drive letters?

I will commit something for the CLASSPATH problem.

~0000192

gloomdemon (reporter)

Yes, javac works normally with ":" as path delimiter, but better use ";".

Configure script under mingw also can not use java.exe (javac.exe) with spaces in path (i.e. c:/program files/java/jdk/javac.exe), and disable java grade.

~0000193

wangp (developer)

I have committed fixes for the first two problems you mentioned.

~0000194

wangp (developer)

Committed further fixes today, except for the problem with spaces in the path.

~0000216

gloomdemon (reporter)

Hi, i get the rotd-2009-11-12 and try to install with java grade under mingw. And get error while linking java class files into grade library: path not found. This old error with /c/Java/jdk1.6.0_12/bin/javac, to check this, i use new compiler mmc --very-verbose --java hello.m and get:

% Compiling `jmercury\hello.java':
% Invoking system command `/c/Java/jdk1.6.0_12/bin/javac -classpath c:/mingw/mer
cury/lib/mercury/lib/java/mer_rt.jar;c:/mingw/mercury/lib/mercury/lib/java/mer_s
td.jar;c:/mingw/mercury/lib/mercury/lib/java/mer_mdbcomp.jar;c:/mingw/mercury/li
b/mercury/lib/java/mer_browser.jar;c:/mingw/mercury/lib/mercury/lib/java/mer_ssd
b.jar -J-Xmx256m jmercury\hello.java'...
??????? ?? ??????? ????? ????????? ????.
Error: system command received signal 1.
% Touching `hello.java_date'... done.

I decided recompile mmc with JAVAC=javac. I tried JAVAC='javac' ./configure ... and add JAVAC=javac to Mmake.params, but configure converts it to /c/Java/jdk1.6.0_12/bin/javac, so i hack configure and make new mmc. While making java grade (mmake LIBGRADES='java' install) get new error:

Making Java class files
Mercury\javas\jmercury\array.java:779: illegal unicode escape
// Mercury\opts\univ.opt:8

file array.java at line 779 contains:

// Mercury\opts\univ.opt:8
          {
            V_4_38 = univ.type_to_univ_2_p_1(TypeInfo_for_T_28, V_12_12);
          }

Mercury added comments on lines while compiling .m to .java but this is old java bug:

http://bugs.sun.com/view_bug.do?bug_id=4364486
http://bugs.sun.com/view_bug.do?bug_id=4324927

~0000217

gloomdemon (reporter)

Converting comment like // Mercury\opts\univ.opt:8 to // Mercury\\opts\\univ.opt:8 solves this problem.

~0000218

wangp (developer)

Thanks for the report. Committed a patch just then.
+Notes

-Issue History
Date Modified Username Field Change
2009-09-28 11:38 gloomdemon New Issue
2009-09-28 22:56 wangp Note Added: 0000191
2009-09-29 03:35 gloomdemon Note Added: 0000192
2009-09-30 03:49 wangp Note Added: 0000193
2009-09-30 03:49 wangp Status new => assigned
2009-09-30 03:49 wangp Assigned To => wangp
2009-10-01 03:26 wangp Note Added: 0000194
2009-10-01 03:26 wangp Status assigned => resolved
2009-10-01 03:26 wangp Resolution open => fixed
2009-11-22 10:50 gloomdemon Note Added: 0000216
2009-11-22 10:50 gloomdemon Status resolved => feedback
2009-11-22 10:50 gloomdemon Resolution fixed => reopened
2009-11-22 11:02 gloomdemon Note Added: 0000217
2009-11-23 22:11 wangp Note Added: 0000218
2009-11-23 22:11 wangp Status feedback => resolved
2009-11-23 22:11 wangp Resolution reopened => fixed
+Issue History