diff --git a/util/m5/README.md b/util/m5/README.md index 9a350e2f37..691347816e 100644 --- a/util/m5/README.md +++ b/util/m5/README.md @@ -341,14 +341,9 @@ library only if that trigger mechanism is supported for that ABI. # Java jar -To use the gem5 java jar, you will need to load the corresponding .so. - -```shell -System.loadLibrary("gem5Ops"); -``` - In your java source, import the gem5Op class which will have methods for -calling each of the gem5 operations. +calling each of the gem5 operations. The .so library will be loaded +automatically. ```shell import gem5.Ops diff --git a/util/m5/src/java/gem5/Ops.java b/util/m5/src/java/gem5/Ops.java index fea5aaddd6..cc92505dda 100644 --- a/util/m5/src/java/gem5/Ops.java +++ b/util/m5/src/java/gem5/Ops.java @@ -42,6 +42,10 @@ package gem5; */ public class Ops { + static { + System.loadLibrary("gem5Ops"); + } + public native void arm(long address); public native void quiesce(); public native void quiesce_ns(long ns);