tags:

views:

168

answers:

4

Do you know of a Java library to access the native linux api?

I guess something like this must use JNI. So be it.

A: 

You can use: Runtime.exec to execute anything you want...

oxbow_lakes
+1  A: 

jtux might help depending on what you want to do.

TofuBeer
A: 

SWIG makes life easier than "raw" JNI with javah etc.

Jon Skeet
+4  A: 

Have a look at JNA.

Here is the summary of JNA from their home page.

JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.

See their getting started page for some samples. Like calling native printf.

Steve K
+1 yeah I couldn't remember the name of this one...
TofuBeer