Jigsaw Quick Start - question

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

Jigsaw Quick Start - question

Andrii Rodionov
Hello!

I am trying to implement an example from Jigsaw Quick Start
(http://openjdk.java.net/projects/jigsaw/doc/quickstart.html).
Modules were compiled and installed successfully. But when I try to
execute the com.greetings ,  I get an exception:
$ /opt/jdk/bin/java -L mlib -m com.greetings
Exception in thread "main" java.lang.NoClassDefFoundError: org/astro/World
        at com.greetings.Hello.main(Hello.java:6)
Caused by: java.lang.ClassNotFoundException: org.astro.World :
requested by +com.greetings
        at org.openjdk.jigsaw.Loader.loadClass(Loader.java:113)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 1 more


In Jigsaw Quick Start module-info.java is next:
$ cat src/modules/org.astro/module-info.java
module org.astro @ 1.2 {
}

After I’ve added line ‘exports org.astro’ to this module:
module org.astro @ 1.2 {
exports org.astro;
}

com.greetings run successfully.

May there be an error in example?

With best regards,
Andrii Rodionov

Reply | Threaded
Open this post in threaded view
|

Re: Jigsaw Quick Start - question

Alan Bateman
On 05/02/2012 09:50, Andrii Rodionov wrote:

> Hello!
>
> I am trying to implement an example from Jigsaw Quick Start
> (http://openjdk.java.net/projects/jigsaw/doc/quickstart.html).
> Modules were compiled and installed successfully. But when I try to
> execute the com.greetings ,  I get an exception:
> $ /opt/jdk/bin/java -L mlib -m com.greetings
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/astro/World
>     at com.greetings.Hello.main(Hello.java:6)
> Caused by: java.lang.ClassNotFoundException: org.astro.World :
> requested by +com.greetings
>     at org.openjdk.jigsaw.Loader.loadClass(Loader.java:113)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
>     ... 1 more
>
>
> In Jigsaw Quick Start module-info.java is next:
> $ cat src/modules/org.astro/module-info.java
> module org.astro @ 1.2 {
> }
>
> After I’ve added line ‘exports org.astro’ to this module:
> module org.astro @ 1.2 {
> exports org.astro;
> }
>
> com.greetings run successfully.
>
> May there be an error in example?
Yes, the quick start guide needs to be updated since the exports
implementation was pushed. We'll get this done soon.

-Alan