kawa and java 9 modules

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

kawa and java 9 modules

Per Bothner
One reason Kawa 3.0 is delayed is I've been trying trying to build and run Kawa on Java 9.
Most of the issues are fixed and checked into git.  One remaining issue relates to
"Modules Shared with Java EE Not Resolved by Default"
https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-F640FA9D-FB66-4D85-AD2B-D931174C09A3
This doesn't affect building Kawa, but it breaks some of the testcases in the testsuite.
These can be fixed by passing the new --add-modules switch to java.  For example:

../bin/kawa.sh -J--add-modules -Jjava.xml.bind -d .. -P testsuite. -T JaxbAnnotations3 -C jaxb-annotations3.scm

One problem is this fails when running under Java 8.  One solution is to pass the -add-modules
option when configured --with-java-source=9 and not otherwise.  That fails when building the
default sources (which will remain java-8 for now) using java-9.  A solution is to check java -version,
in the actual Makefile:

JAVA_VERSION=`java -version 2>&1 |sed -e '1,1s|.*version "\(.*\)"|\1|p' -e '1,$d'`

One idea I had is to add support for --add-modules to the kawa shell script, just like we do for
the -J and -D options.  If not running under Java 9, we ignore the -add-modules option.  (Note the shell
script would have to execute 'java -version' as a separate command, *before* starting the Java/kawa
process, so it would slow things down, though only when using -add-modules.)

I'm leaning to *not* adding -add-modules to the kawa shell script at this time,
but I'm open to adding it later if it would help people.

Any thoughts?
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: kawa and java 9 modules

Helmut Eller-2
On Thu, Sep 28 2017, Per Bothner wrote:

> Any thoughts?

Maybe the JDK_JAVA_OPTIONS environment variable could be used.
According to https://docs.oracle.com/javase/9/tools/java.htm
JDK_JAVA_OPTIONS is new in JDK 9, so presumably it will be ignored in
JDK 8.

Helmut

Reply | Threaded
Open this post in threaded view
|

Re: kawa and java 9 modules

Per Bothner
On 09/29/2017 12:28 AM, Helmut Eller wrote:
> On Thu, Sep 28 2017, Per Bothner wrote:
>
>> Any thoughts?
>
> Maybe the JDK_JAVA_OPTIONS environment variable could be used.
> According to https://docs.oracle.com/javase/9/tools/java.htm
> JDK_JAVA_OPTIONS is new in JDK 9, so presumably it will be ignored in
> JDK 8.

That seems to work, and seems like a good solution.  Thanks!
--
        --Per Bothner
[hidden email]   http://per.bothner.com/