Is a Java program containing native C code language-specific?
Java supports native language code. Does this mean that I can execute the C language code using a java program. If so, it will be machine dependent code or machine independent code, and since the JVM enforces many security constraints on java code, will they affect code that is in C?
Does the JVM enforce restrictions on native language code?
+3
OshoParth
source
to share
1 answer
Yes, the project will be machine dependent. If the native library / code cannot be linked to this JVM (for example, if you have a Windows JVM and an ELF / .so library, or a 32-bit JVM and a 64-bit library), then System.loadLibrary(String)
it won't work with UnsatisfiedLinkError
.
+6
hexafraction
source
to share