为 Java Web Start/JNLP 应用程序缓存的 jar 文件在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1517350/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 13:44:35  来源:igfitidea点击:

Where is the jar files cached for Java Web Start/JNLP applications?

javajnlpjava-web-start

提问by Carl H?rberg

Where is the jar files cached for Java Web Start/JNLP applications?

为 Java Web Start/JNLP 应用程序缓存的 jar 文件在哪里?

采纳答案by Pascal Thivent

It depends... on your OS and virtual machine, e.g.:

这取决于...取决于您的操作系统和虚拟机,例如:

  • with a Sun JDK 1.5 and Windows XP: C:\Documents and Settings\userid\Application Data\Sun\Java\Deployment\cache\javaws\
  • with a Sun JDK 1.6 and Vista: C:\Users\userid\AppData\LocalLow\Sun\Java\Deployment\cache\6.0
  • with a Sun JDK 1.6 and GNU/Linux: /home/userid/.java/deployment/cache/6.0
  • with a Sun JDK 1.6 and Mac OS X: ~/Library/Caches/Java/cache/6.0/
  • 使用 Sun JDK 1.5 和 Windows XP: C:\Documents and Settings\userid\Application Data\Sun\Java\Deployment\cache\javaws\
  • 使用 Sun JDK 1.6 和 Vista: C:\Users\userid\AppData\LocalLow\Sun\Java\Deployment\cache\6.0
  • 使用 Sun JDK 1.6 和 GNU/Linux: /home/userid/.java/deployment/cache/6.0
  • 使用 Sun JDK 1.6 和 Mac OS X: ~/Library/Caches/Java/cache/6.0/

With a Sun JDK 6, this can be configured through the Java Control Panel (Temporary Internet Files Settingsin the Generaltab).

随着太阳JDK 6,这可以通过Java控制面板(Temporary Internet Files文件配置设置常规选项卡)。

回答by JRL

On Windows Vista or 7, it's in %AppData%\LocalLow\Sun\Java\Deployment\cache.

在 Windows Vista 或 7 上,它位于%AppData%\LocalLow\Sun\Java\Deployment\cache.

回答by IgKh

There is more to JNLP than just Sun's implementation.

JNLP 不仅仅是 Sun 的实现。

The OpenJDK packages shipped by Debain, for instance, bundle netx, which stores its files in ~/.netx/cache/. The Wikipedia entryhas a list of known implementations other than Sun's.

例如,Debain 提供的 OpenJDK 软件包捆绑netx,它将其文件存储在~/.netx/cache/. 在维基百科条目比Sun的其他已知的实现的列表。

You really shouldn't rely on this path being well-known in your application's code.

您真的不应该依赖于在您的应用程序代码中众所周知的这条路径。

回答by mantrid

for ubuntu and other debian based linux distros using icedtea: /home/USER/.icedtea/cache

对于使用 icedtea 的 ubuntu 和其他基于 debian 的 linux 发行版: /home/USER/.icedtea/cache

in case you want just to clear the cache javaws -uninstallwon't work. javaws -Xclearcachedoes the job for icedtea.

如果您只想清除缓存javaws -uninstall将不起作用。javaws -Xclearcache为 icedtea 做这项工作。

回答by user2508778

You can easily view or clear (uninstall) your Java WebStart applications. This can be done using the Java Control Panel as described below.http://www.ngs.ac.uk/ukca/certificates/certwizard/clearwebstartcache

您可以轻松查看或清除(卸载)您的 Java WebStart 应用程序。这可以使用 Java 控制面板来完成,如下所述。http://www.ngs.ac.uk/ukca/certificates/certwizard/clearwebstartcache

回答by Wolfgang Fahl

If you are also interested in the content of the jars in the JNLP cache you might want to use the following script (tested on Mac OS X) to examine the jar files with jar -tvf:

如果您也对 JNLP 缓存中 jar 的内容感兴趣,您可能希望使用以下脚本(在 Mac OS X 上测试)通过 jar -tvf 检查 jar 文件:

#!/bin/bash
#   Author: WF
# see http://stackoverflow.com/questions/1517350/where-is-the-jar-files-cached-for-java-web-start-jnlp-applications

os=`uname`
case $os in 
 # Mac OS X
 Darwin*)
   jnlpcache="$HOME/Library/Application Support/Oracle/Java/Deployment/cache/6.0"
     ;;
 *)
   echo "to make this script work for $os you might want to edit it" 1>&2
   echo "and add a case option" 1>&2
     echo "please copy your result back to the stackoverflow answer" 1>&2
     exit 1
     ;;
esac

cd "$jnlpcache"
tmp="/tmp/jnlp$$"
for f in `find . -type f`
do
    jar -tvf $f 2>/dev/null > $tmp
    if [ $? -eq 0 ]
    then
      echo "found jar $f"
        echo "it contains: "
      cat $tmp
    fi
done
rm $tmp