java how to get the path of a running jar file

‮ual.www‬tturi.com
java how to get the path of a running jar file
/**
 * @author lautturi.com 
 * Java example: java get the folder path of running jar
 */
import java.io.File;
import java.net.URISyntaxException;
import java.util.*;

public class Lautturi {

	public static void main(String[] args) throws URISyntaxException {

		String path = new File(Lautturi.class.getProtectionDomain().getCodeSource().getLocation()
			    .toURI()).getPath();
		System.out.println(path);
		
	}

}

output:

F:\hello\bin
Created Time:2017-09-23 20:00:06  Author:lautturi