1

JD Native Swing WebBrowser コントロールを使用する Java アプリケーションを開発していますが、アプリケーションは Windows では正しく動作しますが、Mac では正しく動作しません。私が知っているように、SWT コントロールを実行するには、swt.jar の Mac バージョンを参照する必要があります (完了)。-XstartOnFirstThread 引数も試しましたが、使用すると、アプリケーション全体が起動しません。

アプリケーションは、Swing JFrame を使用して作成されたログイン画面で構成されます。次に、ログインが成功すると、JFrame ログインが破棄されます。SWT WebBrowser コントロールが表示されるはずですが、代わりに例外がスローされます。

On Mac, "NativeInterface.initialize()"/"NativeInterface.open()" should
not be called after AWT static initializers have run, otherwise there
can be all sorts of side effects (non-functional modal dialogs, etc.).
Generally, the problem is when the "main(String[])" method is located
inside an AWT component subclass and the fix is to move that main
method to a standalone class. The problematic class here is
"scribo_formac.MainPage"
***WARNING: Display must be created on main thread due to Cocoa restrictions. 2016-11-22 13:41:54.037 java[797:f07] _createMenuRef
called with existing principal MenuRef already associated with menu
2016-11-22 13:41:54.038 java[797:f07] ( 0   CoreFoundation            
0x00007fff8ac9e0a6 __exceptionPreprocess + 198 1   libobjc.A.dylib    
0x00007fff918613f0 objc_exception_throw + 43 2   CoreFoundation       
0x00007fff8ac9de7c +[NSException raise:format:] + 204 3   AppKit      
0x00007fff8d937eac -[NSCarbonMenuImpl _createMenuRef] + 62 4   AppKit 
0x00007fff8d9377fb -[NSCarbonMenuImpl _instantiateCarbonMenu] + 143 5 
AppKit                              0x00007fff8d936743 -[NSApplication
finishLaunching] + 778 6   libosxapp.dylib                    
0x00000001a9b61e5a -[NSApplicationAWT finishLaunching] + 683 7  
libswt-pi-cocoa-4626.jnilib         0x00000001dbf746e9
Java_org_eclipse_swt_internal_cocoa_OS_objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2J + 153 8   ???                                 0x000000010b6c83b4 0x0 + 4486628276 )
_NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit

それに対する解決策はありますか?-XstartOnFirstThread を実行すると解決できると確信していますが、実行されません。

:-) ご協力いただきありがとうございます。

4

0 に答える 0