如何为 WebStart 程序自动更改 Java 缓存文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1310463/
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
how to change Java cache folder automatically for WebStart programs
提问by ante.sabo
We have a java application deployed in a local LAN, which is cached in JRE cache folder. By default this cache space can be up to 1GB in size and in most cases here all computers have used that space in total.
我们在本地 LAN 中部署了一个 java 应用程序,该应用程序缓存在 JRE 缓存文件夹中。默认情况下,此缓存空间的大小最高可达 1GB,并且在大多数情况下,这里的所有计算机总共使用了该空间。
This will not be an issue if there is no need for doing daily backups of all user's home folders in LAN (and there are more than 200 computers in LAN).
如果不需要每天备份局域网中所有用户的主文件夹(并且局域网中有200多台计算机),这将不是问题。
So, by synchronizing user's home folder batch procedure also synchronizes java cache folder weighing 1GB what in total produces 200x1GB traffic what concerns network administrator.
因此,通过同步用户的主文件夹批处理程序还同步了重达 1GB 的 java 缓存文件夹,总共产生了 200x1GB 的流量,这关系到网络管理员。
Solution is to put java cache folder somewhere outside user's home folder, but that can be done only through control panel. That requires someone to go visit all 200 computers and change that manually... or maybe there is a solution that could do job automatically?
解决方案是将 java 缓存文件夹放在用户主文件夹之外的某个位置,但这只能通过控制面板来完成。这需要有人去访问所有 200 台计算机并手动更改它......或者也许有一个可以自动完成工作的解决方案?
回答by skaffman
Looks like you need to change the deployment.user.cachedirproperty in deployment.properties
看起来您需要更改deployment.user.cachedir属性deployment.properties
http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html
http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html

