Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HdfFile is not API #365

Closed
Mailaender opened this issue Apr 3, 2022 · 7 comments
Closed

HdfFile is not API #365

Mailaender opened this issue Apr 3, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Mailaender
Copy link

Mailaender commented Apr 3, 2022

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
Copy link
Owner

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?

jamesmudd added a commit that referenced this issue Apr 4, 2022
Now includes io.jhdf as well as io.jhdf.*

Also adds Bundle-Version header
@jamesmudd
Copy link
Owner

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
Copy link
Author

I get

Not Found

on the link.

@jamesmudd
Copy link
Owner

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

@Mailaender
Copy link
Author

I can confirm that fixes it.

jamesmudd added a commit that referenced this issue Apr 5, 2022
#365 Fix OSGi Export-Package header
@jamesmudd jamesmudd added the bug Something isn't working label Apr 5, 2022
@jamesmudd jamesmudd self-assigned this Apr 5, 2022
@jamesmudd
Copy link
Owner

Released v0.6.6 including this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants