0

アプリケーションでメソッドを実行すると、次の例外が発生しますが、「JarSignerResources」が欠落しているクラスがクラスパス(tools.jarの一部)にあります。私はこれまでこのような例外を見たことがなく、Linux(OSXではない)でのみ発生します。なぜこれが起こるのかについて、誰かが私に少し洞察を与えることができますか?ありがとう。

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.ExceptionInInitializerError
    at com.wuntee.aat.smali.SmaliWorkshop.signJar(SmaliWorkshop.java:214)
    at com.wuntee.aat.smali.SmaliController.rebuildAndSignApk(SmaliController.java:223)
    at com.wuntee.aat.view.Gui$13.widgetSelected(Gui.java:354)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at com.wuntee.aat.view.Gui.open(Gui.java:135)
    at com.wuntee.aat.view.Gui$1.run(Gui.java:112)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at com.wuntee.aat.view.Gui.main(Gui.java:108)
    ... 5 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name sun.security.tools.JarSignerResources, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
    at com.wuntee.aat.security.tools.JarSigner.<clinit>(JarSigner.java:96)
    ... 17 more

これは、コードのこの時点で発生します。

public static void signJar(String keystore, String keystorePassword, String jarFile, String alias) throws Exception{
    JarSigner js = new JarSigner();
    js.signJar(keystore, keystorePassword, jarFile, alias);
}
4

1 に答える 1

2

sun。*パッケージは、サポートされているパブリックインターフェイスの一部ではありません。Linuxでsunjdkを使用していない可能性があります。

sun。*パッケージを直接呼び出すJavaプログラムは、すべてのJava互換プラットフォームで動作することが保証されているわけではありません。実際、このようなプログラムは、同じプラットフォーム上の将来のバージョンでも機能することが保証されていません。

詳細はこちらをご覧ください

于 2011-10-07T14:00:58.133 に答える