I’m trying to create a small application that will copy some .jar files into the latest jre.
Is there anyway of finding out which is this path?
I’ve looking at the File class and I’ve found several methods that will create an empty file, but I didn’t find anything that would help me copying a file into a given path.
Am I missing any important class?
Thanks
Firstly there isn’t a helper method for copying a file until Java 7 (not yet released). Secondly it is inadvisable to try copying into the JRE directory because you may not have sufficient permission. To find the location of the JRE use System.getProperty(“java.home”)
To copy: