2

jnlpを使用してアプレットを起動しています。アプレットはネイティブライブラリをロードする必要があります。jarとjnlpは、自己生成証明書で署名されています。jnlpは、

<security>
     <all-permissions/>
</security>

ポリシーファイルは、すべてのアクセス許可を付与します。};

「Javaセキュリティ警告」というポップアップダイアログが表示されます。つまり、このアプリケーションは安全でない操作を実行します。続けたいですか ?

続行またはキャンセル(添付のスクリーンショットを参照)

ここに画像の説明を入力してください

「常に許可」ボタンはありません

これは、アプレットが起動される「毎回」ダイアログがポップアップすることを意味します。これはユーザーにとって迷惑です。

このダイアログを無効にしてポップアップしたり、最大で1回だけ表示したりするにはどうすればよいですか?

4

4 に答える 4

3

実際、JNLP の引数に問題がありました。JNLP jre args パラメータに引数を指定することはできません。指定しないと、セキュリティ警告が表示されます。

セキュリティ警告のポップアップを回避するには、638 行目以降にあるリストのプロパティと JVM 引数を使用します: http://javasourcecode.org/html/open-source/jdk/jdk-6u23/com/sun/deploy/config/Config.java .html

JNLP で、JVM 引数にそこに記載されていないものが含まれている場合、証明書に適切に署名したとしても、ポップアップが表示されます。要するに、「保護された」パラメータと適切な証明書を使用すれば問題ありません。

編集

URL が削除されたため、有効な引数は次のとおりです。

// note: this list MUST correspond to native secure.c file
private static String[] secureVmArgs = {
    "-d32",                         /* use 32-bit data model if available */
    "-client",                      /* to select the "client" VM */
    "-server",                      /* to select the "server" VM */
    "-verbose",                     /* enable verbose output */
    "-version",                     /* print product version and exit */
    "-showversion",                 /* print product version and continue */
    "-help",                        /* print this help message */
    "-X",                           /* print help on non-standard options */
    "-ea",                          /* enable assertions */
    "-enableassertions",            /* enable assertions */
    "-da",                          /* disable assertions */
    "-disableassertions",           /* disable assertions */
    "-esa",                         /* enable system assertions */
    "-enablesystemassertions",      /* enable system assertions */
    "-dsa",                         /* disable system assertione */
    "-disablesystemassertions",     /* disable system assertione */
    "-Xmixed",                      /* mixed mode execution (default) */
    "-Xint",                        /* interpreted mode execution only */
    "-Xnoclassgc",                  /* disable class garbage collection */
    "-Xincgc",                      /* enable incremental gc. */
    "-Xbatch",                      /* disable background compilation */
    "-Xprof",                       /* output cpu profiling data */
    "-Xdebug",                      /* enable remote debugging */
    "-Xfuture",                     /* enable strictest checks */
    "-Xrs",                         /* reduce use of OS signals */
    "-XX:+ForceTimeHighResolution", /* use high resolution timer */
    "-XX:-ForceTimeHighResolution", /* use low resolution (default) */
    "-XX:+PrintGCDetails",          /* Gives some details about the GCs */
    "-XX:+PrintGCTimeStamps",       /* Prints GCs times happen to the start of the application */
    "-XX:+PrintHeapAtGC",           /* Prints detailed GC info including heap occupancy */
    "-XX:PrintCMSStatistics",       /* If > 0, Print statistics about the concurrent collections */
    "-XX:+PrintTenuringDistribution",  /* Gives the aging distribution of the allocated objects */
    "-XX:+TraceClassUnloading",     /* Display classes as they are unloaded */
    "-XX:SurvivorRatio",            /* Sets the ratio of the survivor spaces */
    "-XX:MaxTenuringThreshol",      /* Determines how much the objects may age */
    "-XX:CMSMarkStackSize",
    "-XX:CMSMarkStackSizeMax",
    "-XX:+CMSClassUnloadingEnabled",/* It needs to be combined with -XX:+CMSPermGenSweepingEnabled */
    "-XX:+CMSIncrementalMode",      /* Enables the incremental mode */
    "-XX:CMSIncrementalDutyCycleMin",  /* The percentage which is the lower bound on the duty cycle */
    "-XX:+CMSIncrementalPacing",    /* Automatic adjustment of the incremental mode duty cycle */
    "-XX:CMSInitiatingOccupancyFraction",  /* Sets the threshold percentage of the used heap */
    "-XX:+UseConcMarkSweepGC",      /* Turns on concurrent garbage collection */
    "-XX:-ParallelRefProcEnabled",
    "-XX:ParallelGCThreads",        /* Sets the number of parallel GC threads */
    "-XX:ParallelCMSThreads",
    "-XX:+DisableExplicitGC",       /* Disable calls to System.gc() */
    "-XX:+UseCompressedOops",       /* Enables compressed references in 64-bit JVMs */
    "-XX:+UseG1GC",
    "-XX:GCPauseIntervalMillis",
    "-XX:MaxGCPauseMillis"          /* A hint to the virtual machine to pause times */
};

編集

当時、次のような議論がありました。

    <j2se version="1.6.0+"
         initial-heap-size="${heap.init}"
         max-heap-size="${heap.max}"
         java-vm-args="-Djava.security.policy=${jnlp.ip}${jnlp.port}/ed/security/java.policy"/>

問題は -Djava.security.policy にあり、そこから削除するまでポップアップを理解できませんでした。

Java ソース jdk6.23 の新しい URL

于 2012-12-18T17:06:41.140 に答える
3

このダイアログのポップアップを無効にするか、最大でも 1 回しか表示されないようにするにはどうすればよいですか?

信頼できる機関によって検証された証明書を使用してください。自己署名証明書の「常に許可」フィールドを無効化/無視することは、変更される可能性が低いというオラクルの決定です。

于 2011-07-11T03:35:17.653 に答える
1

JAVA_OPTS でリモート デバッグ パラメータを使用すると、このポップアップが表示される場合があります

-agentlib:jdwp=transport=dt_socket,address=localhost:8000,server=y,suspend=n

于 2013-11-12T08:14:42.143 に答える