Pointer/Scope API questions
Jorn Vernee
jorn.vernee at oracle.com
Wed Jan 8 11:02:49 UTC 2020
On 08/01/2020 11:51, Ty Young wrote:
>
>
>>>
>>> BTW, is there something wrong with the memaccess-jextract branch?
>>> I've compiled it, enabled preview features, and added the
>>> jdk.incubator.foreign and jdk.incubator.jextract modules but get an
>>> exception when attempting to run the classes at runtime:
>>>
>>>
>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> jdk/incubator/foreign/SystemABI
>>> at
>>> org.goliath.panamamemtest.PanamaMemTest.main(PanamaMemTest.java:30)
>>> Caused by: java.lang.ClassNotFoundException:
>>> jdk.incubator.foreign.SystemABI
>>> at
>>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
>>> at
>>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
>>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:523)
>>>
>>>
>>> Maven 3.6.2 with release set explicitly to Java 15.
>>>
>>>
>>> The same goes for the jextract module. Given that I can require the
>>> module and import the classes I'm a bit confused as to why it's
>>> doing this. The jmods are visible in the JDK builds so... yeah.
>>>
>> Are you also adding `--add-modules
>> jdk.incubator.foreign,jdk.incubator.jextract` when running? I was
>> seeing a similar error when I forgot to do that.
>
>
> Ah, no. Works now.
>
>
> Is it supposed to throw an exception there though? The modules are
> apart of the JDK and preview features are enabled so I don't
> understand why the extra step of adding the modules at runtime is
> being required here. Is it a bug?
Incubator modules are different from preview features. In fact, you
should not need to use --enable-preview at all (unless you are also
using preview features). The trick with incubator modules is that they
are not resolved by default, so you need to add them explicitly using
--add-modules.
Jorn
>
>>
>> Jorn
>>
>>>> Maurizio
>>>>
More information about the panama-dev
mailing list