Created
May 30, 2017 07:38
-
-
Save hirokazumiyaji/11c9e08ef1e0d865ecbf909dffeb5588 to your computer and use it in GitHub Desktop.
Spring Boot jar file directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo; | |
import java.nio.file.Paths; | |
import java.io.File; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
public class Application { | |
public static void main(String[] args) { | |
File jarFile = new File(System.getProperty("java.class.path")); | |
System.out.println(Paths.get(jarFile.getAbsolutePath()).normalize().getParent().toString()); | |
SpringApplication.run(Application.class, args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment