Notes |
|
|
Do you know if this occurred / occurs with older versions of Java on the same system? |
|
|
(0000713)
|
sebgod
|
2014-06-26 23:46
|
|
On the same machine, I had Java 1.7.5x installed,
Mercury was working fine with that version.
Then I upgraded Java to 1.8.0_05,
When using the command line:
mercury --use-grade-subdirs -s java -m libmercury_misc (e.g.)
then I received the aforementioned error.
Rebuilding the compiler did not resolve that issue.
I could reproduce the error with Mercury 14_01 MinGW32 on Windows XP SP3
with Java 1.8.0 (okay that is not supported but still I got the same error) |
|
|
(0000717)
|
wangp
|
2014-06-27 11:13
|
|
Can you try editing your lib/mercury/conf/Mercury.config file
This line has the wrong quoting
--java-flags "-J"-Xmx1024m""
Try fixing the quoting to
--java-flags "-J-Xmx1024m"
Or perhaps removing the line completely. It may not be needed any more.
|
|
|
(0000719)
|
sebgod
|
2014-06-27 17:21
|
|
Fixing the quoting to --java-flags "-J-Xmx1024m"
still resulted to the complain from the Java compiler,
removing on the other hand resulted in a successful compilation. |
|
|
|
I believe that the quoting on Windows needs to be something like:
--java-flags "-J\"-Xmx1024m\""
That seems to be what I've done in the binary packages for Windows at any rate. |
|
|
(0000721)
|
sebgod
|
2014-06-28 04:00
|
|
Using (in the .config)
--java-flags "-J\"-Xmx1024m\""
yields the same error, I suppose this is a JDK bug.
I'll have to do some tests with "normal" Java programs
and will check the http://java.sun.com/webapps/bugreport
the javac compiler kindly provides. |
|
|
(0000735)
|
sebgod
|
2014-07-05 21:09
(Last edited: 2014-07-05 21:11) |
|
I've tracked down the bug,
Using the mmc -V option I received the content of the "javac @tempfile"
% Args placed in @C:\Users\SEBAST~1\AppData\Local\Temp\mtmp000.3D2: `-classpath <snip> -sourcepath <snip> -d <snip> -J-Xmx1024m Mercury\\java\\i686-pc-mingw32\\Mercury\\javas\\jmercury\\fmt_bug.java'
When invoking javac + the arg string directly on the command line, the compilation is successful.
On a side note, the -J flag is correctly escaped.
Now if I create that @tempfile manually, and running javac @tempfile myself,
I do get the original error with the -J flag not being captured.
Checking the Oracle online documentation for javac:
http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html
revleas that:
@argfiles One or more files that lists options and source files.
The -J options are not allowed in these files.
I suspect that the assertion in the javac compiler was added in Java 8.0,
such that the -J flag passed via the @options-file was previously unnoticed (and most probably dysfunctional)
|
|
|
|
This was fixed in commit 9c85673. |
|
|
|
Actually, commit 9c85673 only fixed the quoting issue. I'll look into fixing the issue with the -J
option being placed in the @options file. |
|
|
|
Fixed (hopefully, for good) in commit d7857cf. |
|