Here you can find the source of createSymlink(Path realFileLocation, Path softLinkLocation)
public static void createSymlink(Path realFileLocation, Path softLinkLocation)
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static void createSymlink(Path realFileLocation, Path softLinkLocation) { try {//w w w . j a v a2s.c o m Files.createSymbolicLink(softLinkLocation, realFileLocation); } catch (IOException e) { System.err.println(e); } catch (UnsupportedOperationException e) { // Some file systems do not support symbolic links. System.err.println(e); } } }