forked from scream3r/java-simple-serial-connector
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
36 additions
and
23 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package jssc.bootpath; | ||
|
||
import org.scijava.nativelib.NativeLibraryUtil; | ||
|
||
/** | ||
* TODO: Invocations MUST be in their own class to run in a separate JVM (https://stackoverflow.com/questions/68657855) | ||
* - JUnit does NOT currently offer JVM unloading between methods. | ||
* - maven-surefire-plugin DOES offer JVM unloading between classes using <code>reuseForks=false</code> | ||
* - Unloading is needed due to NativeLoader.loadLibrary(...) calls System.loadLibrary(...) which is static | ||
* */ | ||
public class Helper { | ||
public static void fixNativesPath() { | ||
String nativeLibDir = NativeLibraryUtil.getPlatformLibraryPath(System.getProperty("user.dir") + "/target/cmake/natives/"); | ||
System.setProperty("jssc.boot.library.path", nativeLibDir); | ||
} | ||
public static void breakNativesPath() { | ||
String nativeLibDir = "/"; | ||
System.setProperty("jssc.boot.library.path", nativeLibDir); | ||
} | ||
} |
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
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