[ACCEPTED]-Where is the jar files cached for Java Web Start/JNLP applications?-java-web-start

Accepted answer
Score: 28

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/

With 3 a Sun JDK 6, this can be configured through 2 the Java Control Panel (Temporary Internet 1 Files Settings in the General tab).

Score: 10

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

0

Score: 3

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

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

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

Score: 3

For ubuntu and other debian based linux 3 distros using icedtea: /home/${USER}/.icedtea/cache

In case you want 2 just to clear the cache javaws -uninstall won’t work. javaws -Xclearcache does 1 the job for icedtea.

Score: 1

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

#!/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
Score: 0

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

More Related questions