get Class Execute Path - Java Reflection

Java examples for Reflection:Class Loader

Description

get Class Execute Path

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getExecutePath());
    }//from ww w .  j a  v  a  2s  . com

    public static String getExecutePath() {
        return ClassLoader.getSystemResource("").getPath();
    }
}

Related Tutorials