天天看點

java web start 問題彙總

  1: 運作java web start所需的jar檔案都需要簽名才能通過,如果jar包裡有中文檔案名可能用jarsigner能使簽名通過,但java web start還是不能運作程式。

  2: 如果運作程式所需的有些jar包已經簽名,則需删除(看看jarsinger包裡都多了些什麼檔案就知道怎麼删除了)這些簽名換上統一的簽名,或者替換這些jar包為未簽名的同一種jar包,然後再jarsigner置換成和其他包一樣的簽名。

  3: 所有jar包的簽名必須是同一時間的,是以簽名前先删除以前簽名過的jar包,避免有些jar包中的檔案沒有修改就不在簽名而導緻java web start啟動時候的簽名不一緻的問題。

  4: 如何debug java web start 程式

  To debug a WebStart application in Java 6, start to enable remote debugging;

  C:/Programme/java/jre1.6.0_01/bin/javaws.exe -J-Xdebug -J-Xnoagent

   -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8200

   c:/foo.jnlp

  To achieve the same with Java versions prior 6 (1.4, 5), set the environment variable JAVAWS_VM_ARGS to the arguments above, but only write ‘-J’ once before the first argument.

set JAVAWS_VM_ARGS=-J-Xdebug -Xnoagent

   -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8200

C:/Programme/java/jre1.6.0_01/bin/javaws.exe c:/foo.jnlp

if you use “suspend=y” instead of “suspend=n”, then the application will wait for the debugger to connect, before it starts up. your choice depends on what you want to debug in your application.

also important, make sure the JNLP file is a local file (”c:/foo.jnlp”) and not specified as a URL (”http://foo.com/foo.jnlp”). As this does not work.

if JNLP file has spaces, should enclosed with double quotes.

  Then connect your debugger like eclipse remote debugger to the specified port (here: 8200), if connected, then you can debug the application in eclipse

  If the debugger cannot connect, verify with netstat that no Personal Firewall or AntiVirus is blocking the connection.