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
16
votes
6 answers

Determine whether a file is a junction (in Windows) or not?

I've been searching around trying to find a way to determine if a file is a junction or not, and have not found any satisfactory answers. First thing I tried was: Files.isSymbolicLink(aPath) It detects only symbolic links not the files referred to…
Martin
  • 1,130
  • 10
  • 14
14
votes
7 answers

Unable to load JNA native support library Elasticsearch 6.x

I have installed Elasticsearch 6.x in my Debian 7 (wheezy). I tried to start with service elasticsearch start but its give me an error message root@debian:~# sudo -i service elasticsearch start [FAIL] Starting Elasticsearch Server: failed! I tried…
Gagantous
  • 432
  • 6
  • 29
  • 69
14
votes
2 answers

What is the difference between JNA and JNR

According to the image from here both libraries work according to the same principle. But I believe that there is a difference between them. What is this difference?
Pavel_K
  • 10,748
  • 13
  • 73
  • 186
14
votes
2 answers

How to manipulate memory from Java with JNA on Windows

How do I manipulate memory from Java? I know that Java runs in it's own JVM, so it can't access process memory directly. I heard about JNA which can be used to get interfaces between the Operating System and my Java code. Let's say I want to…
Loki
  • 4,065
  • 4
  • 29
  • 51
13
votes
7 answers

UnsatisfiedLinkError - Unable to load library - Native library not found in resource path

I have the following error at runtime, while trying to run Tess4J: Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302': Native library (win32-x86-64/libtesseract302.dll) not found in resource path…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
12
votes
1 answer

How to get list of all window handles in Java (Using JNA)?

I am novice for JNA. I am trying to get handles for all the windows including minimised ones. I need HWND of all the windows. I have gone thro the question Windows: how to get a list of all visible windows? which helped me to get list of windows,…
Ahamed
  • 39,245
  • 13
  • 40
  • 68
12
votes
3 answers

How do I get maven to download the platform.jar from the JNA project

I have the following POM entry net.java.dev.jna jna 3.3.0 When I build my project it downloads the following files: jna-3.3.0.jar …
Preston
  • 3,273
  • 4
  • 26
  • 35
12
votes
1 answer

Library shutdown routine that works well in a "normal" Java application and in a web application

I maintain a JDBC driver that also has an embedded database server mode provided through a native library, which is accessed through JNA. The shutdown process, done as part of unloading the native library itself, runs into problems on Windows due to…
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
12
votes
5 answers

Trying to use DLL from Java (JNA). Unable to load library exception

I have NetBeans project from tutorial which causes exception: Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'simpleDLL': The specified module could not be found. Tried to put simpleDLL.dll in project libraries,…
Karloss
  • 817
  • 3
  • 9
  • 27
11
votes
3 answers

GetAsyncKeyState and VirtualKeys/special characters using JNA (JAVA)

I am working on a two-way private chat that will work in a full screen game. This is required to let the user to type into a semi-transparent textbox at the top of the screen even when it doesn't have focus. Using the following code, I can detect…
David
  • 15,652
  • 26
  • 115
  • 156
11
votes
2 answers

Using JNA to get GetForegroundWindow();

I asked a similar question on a previous thread (https://stackoverflow.com/questions/5206633/java-find-out-what-application-window-is-in-focus) but I was guided to use JNI, and I'm not having much success with it... I've read some tutorials and…
Daniel Loureiro
  • 601
  • 2
  • 7
  • 12
11
votes
1 answer

Using JNA to link to custom dll

how do I access custom .lib / .dll functions using JNA? Can someone provide an example? Thank you.
gwen
11
votes
3 answers

Hunspell on Android

Does anyone successfully implemented Hunspell spell-checker on Android platform? Is it even possible? Did you try it? What about the results? Thank you in advance.
z.b
  • 111
  • 4
11
votes
1 answer

Disable Background drawing in JFrame in order to properly display Aero (DWM) effects

I'm having problems using the DWM functionality of Windows Vista/7 on Java windows. I want to make the background of my frame use the Aero style. The Windows API to do so is provide by the function DwmExtendFrameIntoClientArea in the dwmapi library.…
Daniel Dreibrodt
  • 1,297
  • 2
  • 9
  • 11
11
votes
1 answer

How do I fix "incompatible JNA native library" when using Putty, Gradle, and the Gradle Git plugin?

I have this simple build script: import org.ajoberstar.grgit.Grgit apply plugin: 'application' apply plugin: 'org.ajoberstar.release-opinion' task wrapper(type:Wrapper) { gradleVersion = '2.1' } buildscript { repositories { …
Jason
  • 11,709
  • 9
  • 66
  • 82