Questions tagged [jna]
Java Native Access (JNA) provides pure Java access to native shared libraries without the need for additional native or JNI code.
2,020
questions
-1
votes
0
answers
27
views
Starting GUI application from Windows Service [closed]
I want to open an application and start the printing process from Windows Service. How to do this in java?
I tried using Scheduled tasks. But sometimes the tasks are not getting deleted after task ...
0
votes
1
answer
29
views
How do I fix the Java unsatisfied link error when using JNA in Apache MiNiFi running inside a podman container
I have an Apache NiFi dataflow that transports data between two directories on my system through POSIX message queues using two NiFi processors that I made. These processors use JNA to make the calls ...
2
votes
2
answers
70
views
How to access global variable via JNA interface?
I need to access a "native" C library from Java via Java Native Access (JNA). The idiomatic way to do this seems to be defining an interface that extends Library and that declares all the ...
1
vote
2
answers
30
views
Apache Cassandra fails to start - SIGSEGV error when using non-default tmp directory
I'm deploying Apache Cassandra on a managed RHEL8 instance. I can install and start Cassandra successfully if I remount /tmp without the noexec flag. Overnight the noexec flag is reinstated by company ...
2
votes
0
answers
66
views
Windows Display Scaling affecting a JFrame
My Java application takes a screenshot of the screen and then displays it.
Normally this would be a funny prank where a user would click around and there would be no response as they're trying to ...
0
votes
0
answers
18
views
Calling Wintrust.WinVerifyTrust from Java via JNA returns error on signed .exe file
First time using JNA library and probably doing something wrong.
My goal is to verify an Authenticode signature of an executable file by calling the WinVerifyTrust function (from the Windows WinTrust ...
0
votes
0
answers
37
views
Unable to listen to WinApi messages using JNA on Kotlin Multiplatform App
Im trying to set messaging between two instances of my kotlin desktop (windows) project.
The app is a music player and the idea is that once an instance of the app is already running, new instances ...
0
votes
0
answers
32
views
Why only one structure argument can be passed by value through Callback interface, the rest arguments are ignored?
public class SampleStruct extends Structure {
public static class ByReference extends SampleStruct implements Structure.ByReference {}
public static class ByValue extends SampleStruct ...
0
votes
0
answers
54
views
When I use the jna method, the java call to c# keeps running with an error saying "java.lang.Error: Invalid memory access"
When I use the jna method, java calls c# with a constant error.
java.lang.Error: Invalid memory access
c# code is below (64 bit),
namespace EwpDeleteBlank
{
public static class RemoveBlankPage
...
-1
votes
1
answer
61
views
java.io.IOException: To use Lanterna on Windows, either add JNA (and jna-platform) to the classpath (or use javaw)
Context
I created a Lanterna TUI which works perfect on Ubuntu, and I am testing it on Windows 11. When I run the command with javaw, a separate terminal is created that is glitches as soon as one ...
0
votes
0
answers
19
views
how to receive int array by pass a int pointer from java using JNA?
I'm currently working on a project which requires developing a Java application to access a native DLL (in C). I have chosen JNA for the bridging job and I am facing problems passing correct int ...
0
votes
2
answers
35
views
Converting BufferedImage to Pixmap
Is there some way to convert a BufferedImage to X11 Pixmap? It looks like JNA has com.sun.jna.platform.unix.X11.Pixmap but I can't find a way to convert anything to that format.
1
vote
1
answer
217
views
Cannot load native library on Android: Native library not found in resource path
I am developing a Rust library named Galileo with FFI to Android, and am trying to run it in Android emulator.
It compiles fine with the command and produces x86 directory where you'd expect:
cargo ...
1
vote
1
answer
65
views
How can I get name of currently running app (same as in task manager) with Java? (Windows)
Here is my code which is supposed to print name of currently used app:
import com.sun.jna.Native;
import com.sun.jna.platform.win32.*;
import com.sun.jna.ptr.IntByReference;
public class AppList {
...
0
votes
0
answers
57
views
can I use JNI/JNA to work with libcrypto-3-x64.dll?
I have install OPENSSL in my computer, and there is a file named "libcrypto-3-x64.dll" in my "system32" folder.
Can I use JNI or JNA to work with libcrypto-3-x64.dll ?
I can use ...