One would like to change the cache location of Java, which has a default size limit of 1000MB, to save space on system drive. By default the setting is per user, so it can take quite a lot of space on the system drive, depending upon the java usage and number of users.
On windows XP, Java cache location can be changed though java control panel which can be accessed
control panel >> Java >> General >> Setting >> Location
But this setting change is missing in Wind0ws 7 through the control panel, in which the above mentioned location is greyed out. To get the desired any of the following method can be used.
Method 1 : Locate javacpl.exe in the java installation directory, and in the
properties >> compatibility >> Choose run this program in compatibility mode for “Windows XP SP3”
The above change would enable the location change setting in the Java control panel, and then you can change the cache location.
Method 2: Java configuration properties can be changed by making changes in file “deployment.properties” which is normally located at
%SYSTEMDRIVE%\Users\%USERNAME%\AppData\LocalLow\Sun\Java\Deployment
Change(or add if not there) the property “deployment.user.cachedir” and set it to the desired cache location. Make sure that you escape all the ‘\’ and ‘:’ with ‘\’ in the directory name of the cache location. For Ex if you would like to set the cache to E:\Temp\Java\Cache set the value as
deployment.user.cachedir=E\:\\Temp\\Java\\Cache
Also make sure that java control panel is not open while you are making changes as it would over-write the setting to the one with which its started.
The change needs to be done per user. There are more properties which can be changed by making changes in the “deployment.properties” file, for the list of same please refer to the following url
http://download.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/properties.html
Note : By default the “AppData” folder is hidden and would not be visible when you are opening using explorer. One way is to select on explorer
Tool >> View >> Show hidden files…
or else you can open the file directory by using open on your editor and giving following path
%SYSTEMDRIVE%\Users\%USERNAME%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
Thats all.