Hello,
I want to set the cache directory because i cannot use AppData/Local/Temp/ for a certain reason. I'm using URLClassLoader, and i want it to temporarily save in another folder instead of AppData/Local/Temp/. How can i do this?
Please help,
Thanks Dunnkers.
4 replies to this topic
#1
Posted 10 May 2011 - 12:45 PM
|
|
|
#2
Posted 10 May 2011 - 03:16 PM
You need to change the Java Runtime's tmpdir property. You can do that like so:
java -Djava.io.tmpdir=C:\my\file\location MyProgramSee if that works, since I believe URLClassLoader just saves temp data to the folder on that property.
Wow I changed my sig!
#3
Posted 11 May 2011 - 07:16 AM
How can i change this when in java? In my code itself? Also, i cannot use exec.
#4
Posted 11 May 2011 - 10:46 AM
I haven't tested it, but I'd use System.setProperty:
String propertyName = "java.io.tmpdir"; String oldLocation = System.getProperty(propertyName); System.setProperty(propertyName, "/location/of/file"); // Do your other stuff here. System.setProperty(propertyName, oldLocation);
Wow I changed my sig!
#5
Posted 11 May 2011 - 01:07 PM
Thanks allot! This worked for me!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









