jamesmudd / jhdf

A pure Java HDF5 library
http://jhdf.io
MIT License
141 stars 38 forks source link

HdfFile is not API #365

Closed Mailaender closed 2 years ago

Mailaender commented 2 years ago

Describe the bug

I get

Access restriction: The type 'HdfFile' is not API (restriction on required library '~/.m2/repository/io/jhdf/jhdf/0.6.5/jhdf-0.6.5.jar')

To Reproduce

The first line of the README in fact:

try (HdfFile hdfFile = new HdfFile(file)) {

I used @eclipse-m2e to add it to the .target platform

    <location includeDependencyDepth="none" includeSource="true" missingManifest="generate" type="Maven">
        <dependencies>
            <dependency>
                <groupId>io.jhdf</groupId>
                <artifactId>jhdf</artifactId>
                <version>0.6.5</version>
                <type>jar</type>
            </dependency>
        </dependencies>
    </location>

Expected behavior

No access rule error.

jamesmudd commented 2 years ago

Thanks for opening this issue. I'm not exactly clear what the issue is. I tried creating a project in eclipse 2022-3 with Java 11 and imported the jhdf lib ok and it worked correctly. So i'm assuming I haven't reproduced your setup. Would you be able to zip up and attach your eclipse workspace? Or give a bit more detail on how you are running the app. Are you running in OSGi environment?

Mailaender commented 2 years ago

Yes, I tried to add it to https://github.com/OpenChrom/openchrom/blob/develop/openchrom/releng/net.openchrom.targetplatform/net.openchrom.targetplatform.target

jamesmudd commented 2 years ago

Think I have reproduced the issue and the cause is a mistake in the Export-Package manifest header. There is a PR #367 which I think fixes the issue. Here is a test jar with the headers changed jhdf-0.6.6-osgi-beta.zip (rename .zip to .jar) Would be great if you could test it and let me know if this fixes this issue.

Mailaender commented 2 years ago

I get

Not Found

on the link.

jamesmudd commented 2 years ago

Sorry try this one (not sure what happened there) jhdf-0.6.6-osgi-beta.zip

Mailaender commented 2 years ago

I can confirm that fixes it.

jamesmudd commented 2 years ago

Released v0.6.6 including this fix