Created
          June 24, 2015 15:45 
        
      - 
      
- 
        Save lildata/cb04ab4cdaee62afe1fe to your computer and use it in GitHub Desktop. 
    You usually can't change java.library.path at runtime since it seems to be evaluated at the start and then cached. But with this little trick it is being reevaluated.
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | System.setProperty("java.library.path", newpath) | |
| val fieldSysPath = classOf[ClassLoader].getDeclaredField("sys_paths") | |
| fieldSysPath.setAccessible(true) | |
| fieldSysPath.set(null, null) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment