Questions tagged [jna]

Java Native Access (JNA) provides pure Java access to native shared libraries without the need for additional native or JNI code.

Project website

Resources

1997 questions
7
votes
1 answer

Mouse click with JNA

I'm trying to simulate mouse click at window with JNA. public class App { public static final int WM_LBUTTONUP = 514; public static final int WM_LBUTTONDOWN = 513; public static final int WM_LBUTTONDBLCLK = 0x203; static int WM_CLOSE = 0x10; final…
NullPointer
  • 924
  • 14
  • 27
7
votes
2 answers

JNA loading libraries

I've got two libraries, one with Ada objects and one with C++ objects (I don't have a lot of control about which goes where) The Ada stuff references the C stuff and vice versa... This symbol is in libIPCAda.so: ipc_manager_shutdown_c This symbol…
mainstringargs
  • 13,563
  • 35
  • 109
  • 174
7
votes
1 answer

how to implement alt+tab like feature using java?

Image shows what getDisplayMedia() does I want to show user, all the current opened applications/windows (like that of alt+tab) using java. In javaScript we can do this by Media Devices interface getDisplayMedia(). I want to implement similar…
Nirman
  • 103
  • 2
  • 11
7
votes
4 answers

JAVA JNA WindowProc implementation

I'm trying to write a simple application in Java that will communicate with an USB device. The USB device is made by me using a Microchip Microcontroller. The communication is rather simple, since the USB device is from the HID Class, arrays of 64…
Gabor
  • 197
  • 1
  • 9
7
votes
2 answers

Virtual Joystick in Java

Have you heard of a virtual joystick for Windows that has Java wrappings? I've trying PPJOY, and it works great, but then I'll need to use JNI to get it working from Java and that doesn't seem easy for the time being. Thanks!
Albus Dumbledore
  • 12,368
  • 23
  • 64
  • 105
7
votes
2 answers

Working example of JNA mouse hook

Can any one provide me with a working example of JNA mouse hook, which would be able to track mouse movements/click outside my Java Swing application ? Thanks in Advance
user433619
  • 91
  • 1
  • 2
7
votes
1 answer

is memory allocated in JNA (or JNI) by the C code limited by jvm (param -Xmx or architecture 32/64)

that is, could a malloc() asking for 5 mb in the C part fail due to: jvm was run with -Xmx32m and jvm heap is already 30 mb something to do with jvm being 32 bits in a 64 bits windows
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
7
votes
2 answers

JNA - calling methods upon C++ instance passed back from DLL

Say I have a C++ DLL with a single exported method such as: CustomerProcessor* getInstance(); i.e. it simply returns an instance of the class that actually contains the methods I need to call. I know I can map the getInstance() method to a Class in…
William
  • 13,332
  • 13
  • 60
  • 73
7
votes
2 answers

How to use C# function in Java using JNA lib

I've spent many hours trying to use a C# function inside my Java Application but had no success... I wrote the following lib in C#: public class Converter { public Converter() { } public bool ConvertHtmlToPdf(String directoryPath) …
Victor Laerte
  • 6,446
  • 13
  • 53
  • 102
7
votes
1 answer

How to make structure in JNA?

I get this error when i run the code below; Exception in thread "AWT-EventQueue-0" java.lang.Error: Structure.getFieldOrder() on class javaapplication2.NewJFrame$APPBARDATA returns names ([cbSize, hWnd, jCallbackMessage, jEdge, rc, sParam]) which do…
MOD
  • 1,070
  • 3
  • 19
  • 41
7
votes
4 answers

How to call external dll function from java code

I need to call external DLL library function from Java code. I use Netbeans 7.2. My dll's functions are: Boolean isValid(string word) List getWords(String word) I'm following this example. But I don't know how declare my dll…
Temp Temp
  • 121
  • 1
  • 1
  • 3
7
votes
5 answers

JNA native support (/com/sun/jna/linux-arm/libjnidispatch.so) not found in resource path

I have started to build a java service which incorporates JNA to load a native C/C++ lib and i want to run the java service on the Raspberry PI aka arm platform. I have successfully built a stable ground of the service and it runs on both Windows7…
Pär Fransman
  • 71
  • 1
  • 1
  • 4
7
votes
3 answers

Returning C array to Java using JNA

I am not too familiar with C, but I need to use a C library in my java code. I have created the DLL and am able to access it just fine, but I am attempting to return an array of ints from the C code to the java code. In C I thought you could simply…
ravun
  • 1,523
  • 9
  • 27
  • 45
7
votes
3 answers

What is the easiest way to call a Windows kernel function from Java?

While searching for how to do this, I found some vague discussion about different options, like JNI vs JNA, but not much in the way of concrete examples. Context: if Java's File.renameTo() cannot do it's job (for whatever reason; it is a little…
Jonik
  • 80,077
  • 70
  • 264
  • 372
6
votes
2 answers

GUI in Java, Backend in SML?

I'm a big fan of functional programming languages (namely Standard ML and its dialects), mainly because of their expressiveness which allows for very consise, clean code. I can solve many problems dramatically faster with ML than with say…
smolkaj
  • 91
  • 4