Skip to content

“Could not initialize class com.sun.jna.platform.mac.MacFileUtils$FileManager” during Export on Big Sur #159

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

Closed
processing-bot opened this issue Jan 21, 2021 · 2 comments

Comments

@processing-bot
Copy link
Collaborator

Created by: MarcinKonowalczyk

I'm using Processing 4.0a3 on macOS Big Sur 11.1. An error occurs when exporting an application dependent on files in the "data" folder. The following code works, but not after uncommenting the font = ... line.

PFont font;
void setup() {
  \\font = loadFont("Helvetica-12.vlw"); textFont(font,12);
  textAlign(CENTER,CENTER); fill(0);
}

void draw() {
  text("Hi",width/2,height/2);
}

Of course, 'Helvetica-12.vlw' is in ./data:

p4_loadfont_mfe.pde
data/Helvetica-12.vlw

Stacktrace

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.platform.mac.MacFileUtils$FileManager
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1042)
	at java.base/jdk.internal.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
	at java.base/jdk.internal.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:186)
	at java.base/java.lang.reflect.Field.acquireFieldAccessor(Field.java:1105)
	at java.base/java.lang.reflect.Field.getFieldAccessor(Field.java:1086)
	at java.base/java.lang.reflect.Field.get(Field.java:418)
	at com.sun.jna.Native.loadLibraryInstance(Native.java:667)
	at com.sun.jna.Native.getLibraryOptions(Native.java:737)
	at com.sun.jna.Native.getStructureAlignment(Native.java:829)
	at com.sun.jna.Structure.setAlignType(Structure.java:280)
	at com.sun.jna.Structure.<init>(Structure.java:197)
	at com.sun.jna.Structure.<init>(Structure.java:193)
	at com.sun.jna.Structure.<init>(Structure.java:180)
	at com.sun.jna.Structure.<init>(Structure.java:172)
	at com.sun.jna.platform.mac.MacFileUtils$FileManager$FSRef.<init>(MacFileUtils.java:57)
	at com.sun.jna.platform.mac.MacFileUtils.moveToTrash(MacFileUtils.java:74)
	at processing.app.Platform.deleteFile(Platform.java:390)
	at processing.app.Mode.prepareExportFolder(Mode.java:1028)
	at processing.mode.java.JavaBuild.exportApplication(JavaBuild.java:635)
	at processing.mode.java.JavaBuild.exportApplication(JavaBuild.java:600)
	at processing.mode.java.JavaMode.handleExportApplication(JavaMode.java:238)
	at processing.mode.java.JavaEditor.exportApplicationPrompt(JavaEditor.java:996)
	at processing.mode.java.JavaEditor.handleExportApplication(JavaEditor.java:623)
	at processing.mode.java.JavaEditor$3.actionPerformed(JavaEditor.java:246)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369)
	at java.desktop/com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:129)
	at java.desktop/java.awt.MenuItem.processActionEvent(MenuItem.java:690)
	at java.desktop/java.awt.MenuItem.processEvent(MenuItem.java:649)
	at java.desktop/java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:375)
	at java.desktop/java.awt.MenuComponent.dispatchEvent(MenuComponent.java:363)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
@processing-bot
Copy link
Collaborator Author

Created by: benfry

Updated the bug title; this is an issue with JNA on Big Sur. I've already added a catch for it with this commit: 740e4b5 so this should be fixed when I have a chance to post 4.0 alpha 4.

@processing-bot
Copy link
Collaborator Author

Created by: github-actions[bot]

This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant