Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java get location of jar file

//this worked for me
File jarDir = new File(ClassLoader.getSystemClassLoader().getResource(".").toURI());

//this didn't work for me but it is often suggested
File jar = new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation().toURI());
Comment

PREVIOUS NEXT
Code Example
Java :: sort descending in java 
Java :: how to change a bukkit chat format 
Java :: set html text android java 
Java :: jbutton actionlistener 
Java :: java dictionary 
Java :: java kommentointi 
Java :: int to string java 
Java :: material design android dependency androidx 
Java :: java custom color 
Java :: method to check parameters in java 
Java :: random between two numbers java 
Java :: android java get resource string 
Java :: absolute method in jdbc 
Java :: go to activity android 
Java :: string to localdate in java 
Java :: java intercept ctrl c 
Java :: android how to determine if the edit text focus changes 
Java :: Date from String java3 
Java :: spigot sounds 
Java :: concurrent modification exception 
Java :: jda embed message 
Java :: how to change top of window in java 
Java :: append button jframe 
Java :: change text color in joptionpane 
Java :: java get current date 
Java :: Java @Inherited 
Java :: dupplicate classes android 
Java :: java how to override a private method 
Java :: how to count lines from txt java 
Java :: json date format for localdate java 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =