Usage question
Peter Levart
peter.levart at gmail.com
Tue Sep 27 14:45:58 UTC 2016
On 09/27/2016 12:59 PM, Alan Bateman wrote:
> On 27/09/2016 11:41, Andrew Haley wrote:
>
>> Sorry, this should be simple, but I don't get it.
>>
>> In this program:
>>
>> import java.util.logging.Logger;
>>
>> public class TestClass {
>> }
>>
>>
>> aph at arm64:~/SPECjvm2016/unpack$
>> ~/hs-comp/build/linux-aarch64-normal-server-release/images/jdk/bin/javac
>> --add-reads
>> java.compiler=java.logging,java.prefs,java.desktop,ALL-UNNAMED
>> -Xmodule:java.compiler TestClass.java
>> TestClass.java:1: error: package java.util.logging does not exist
>> import java.util.logging.Logger;
>> ^
>> 1 error
>> aph at arm64:~/SPECjvm2016/unpack$ cat TestClass.java
>>
>> I'm a bit baffled.
> javac could probably emit a better message here. In any case, can you
> add `--add-modules java.logging` to this. The issue is that you are
> compiling TestClass "as if" it's in the java.compiler module but that
> module does not require java.logging. There has been suggestions that
> --add-reads should imply --add-modules but no conclusion on that.
>
> -Alan
Perhaps it is better to separate those two things. For convenience,
there could be another option like --add-requires that would imply both
--add-reads and --add-modules...
Regards, Peter
More information about the jigsaw-dev
mailing list