Currently I use 'ln
' command via Runtime.exec()
. It works fine. The only problem is that in order to do this fork, we need twice the heap space of the application. My app is a 64 bit app with heap size around 10Gigs and thus its runs out of swap space. I couldn't find any configuration that could fix this.
I also want not to use JNI for the same. Also I had heard somewhere that this facility will soon be provided in java 7.
It’s easy in Java 7 using createLink:
Files.createLink(Paths.get("newlink"), Paths.get("existing"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With