Created
February 14, 2019 13:06
-
-
Save brake/efae5d03aa14e7ba7cb448ec66e69b30 to your computer and use it in GitHub Desktop.
Get executable jar path on Kotlin
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
fun getExecutablePath(): File? = | |
Paths.get(object {}.javaClass.protectionDomain.codeSource?.location?.toURI()).parent.toFile() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment