Webstart和JavaCompiler API限制

时间:2011-08-23 21:31:12

标签: java api lwjgl java-compiler-api

我有一个只签署了罐子的应用程序,所有这些都是同一个证书,我的。我不想用Webstart运行应用程序。应用程序运行编译器,编译的代码运行LWJGL。但是当我运行应用程序时,它会通过编译的代码返回错误,它实际上无法找到LWJGL(-library)包(原始应用程序可以看得很清楚)。当我将应用程序编译为Trusted-Library时,它也会出错:

Exception in thread "CompilerThread" java.lang.NoClassDefFoundError: com/sun/tools/javac/api/JavacTool
    at customcompile.CustomCompile$2.run(CustomCompile.java:82)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.api.JavacTool
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more

http://download.oracle.com/javase/6/docs/technotes/guides/jweb/mixed_code.html 我找到了这个网站,但它并没有让我对这个特定主题更加明智,因为它显然与编译后的代码处理方式不同于其他代码。

任何人都可以帮我解决这个问题吗?或清除它?

编辑:我已经断定编译后的代码被视为无符号。 要识别库,需要将它们添加到类路径中。

1 个答案:

答案 0 :(得分:0)

我认为将System.getProperty调用等重定向到已签名的类将解决未签名代码中的任何问题,从而间接地为其提供更多权限。