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 o
This is very easy with JNA:
public interface CLibrary extends Library {
CLibrary INSTANCE = (CLibrary)
Native.loadLibrary((Platform.isWindows() ? "msvcrt" : "c"),
CLibrary.class);
int link(String fromFile, String toFile);
}
public static void main(String[] args) {
CLibrary.INSTANCE.link(args[0], args[1]);
}
Compile and run!