Questions tagged [jnaerator]

A tool in order to easily call C/C++/Obj-C native libraries into java.

JNAerator (homepage) is a tool which parses C/C++/Obj-C sources and generates sources for libraries BridJ, JNA and Roccoa : so that calling native libraries from Java is painless.

38 questions
4
votes
1 answer

How to use JNAerator with multiple dynamic libraries under one header?

I am using JNAerator to generate a single jar file I can include in a project, and I'd like to support the dynamic libraries for each operating system and arch all in this single jar. In fiddling with JNAerator so far, I've been able to include a…
3
votes
2 answers

How to use JNAerator?

I want to use JNAerator to generate the Java wrapper of some C++ API functions for JNA. The Problem is that I can't use JNAerator Studio or access Github from my PC at work. I only have the .zip-file from the Github-repository. I can't find any…
MariaM
  • 47
  • 1
  • 9
3
votes
3 answers

What is the easiest way to call Objective-C code from Java?

I need to access a list of Wifi devices on Mac OSX from Java code and after researching it, I've found that I need to resort to "native" code - namely the CoreWLAN framework and the CWInterface.h class…
tomdee
  • 2,319
  • 5
  • 25
  • 39
3
votes
3 answers

How to convert String value to Pointer (Java, JNAerator)?

I have converted .dll library to JAR by using JNAerator. Now I need to call OpenTCPIPPort_V method which looks like this: public static short OpenTCPIPPort_V(Pointer tcpPort, Pointer IPAddr) How to pass two string values to this…
Karloss
  • 817
  • 3
  • 9
  • 27
2
votes
0 answers

How to access functions of a class inside a dll using Java (JNA)

I am trying to use several functions of class CashDrawer (https://learn.microsoft.com/en-us/uwp/api/Windows.Devices.PointOfService.CashDrawer) that are inside a windows dll called Windows.Devices.PointOfService.dll through Java using JNA, samples…
Mben
  • 21
  • 4
2
votes
1 answer

JNA Exception in thread "main" java.lang.Error: Invalid memory access(Unknown Source)

I'm using JNA 4.0.0 to access some DLL function from Java, this DLL Native Function is declared as the following: int ApplicationInit(HANDLE hEMV, TLV *tlv_Appl, TLV *tlv_AIP); Types of the input parameters are described below /* Opaque structure…
Bace
  • 23
  • 1
  • 1
  • 5
2
votes
0 answers

how to use C code in java using Bridj

I am new to java and I am trying to use a sample 'Hello world' C function in Java using Bridj on Raspberry pi B+(armv6l). I downloaded Bridj source code and installed it using maven. Then I downloaded JNAerator and generated a java code out of my C…
Ravi
  • 986
  • 12
  • 18
2
votes
1 answer

BridJ type mapping for unsigned types

When generating BridJ code with JNAerator, it maps unsigned types (for example windows' ULONG) to a normal Java long: // c code typedef struct _S { USHORT a; ULONG b; ULONG64 c; } S; // generated java code class S extends…
S1lentSt0rm
  • 1,989
  • 2
  • 17
  • 28
2
votes
1 answer

use Pointer address in Java using Bridj and JNAerator

I have this code in C and I would like to write the same in Java: static u_int32_t print_pkt (struct nfq_data *tb){ unsigned char *data; ret = nfq_get_payload(tb, &data); if (ret >= 0) printf("payload_len=%d ", ret); …
user1928596
  • 1,503
  • 16
  • 21
2
votes
1 answer

The jnaerator's SimpleMeaningfulExample for generating Java JNA wrappers won't work

I tried the jnaerator SimpleMeaningfulExample (http://code.google.com/p/jnaerator/wiki/SimpleMeaningfulExample) and got: $ java -jar jnaerator-0.9.2.jar -library Test Test.h -o . -v Exception in thread "main" java.lang.UnsupportedClassVersionError:…
Daryl Spitzer
  • 143,156
  • 76
  • 154
  • 173
2
votes
2 answers

Generate Java classes from .dll

I have a device which I want to access from java. The only way to do this is using a dll library provided by the manufacturer. I have read about JNI, JNA etc. and maybe there is a tool outside which analyses the dll and generates the Java classes…
sebastian
  • 2,427
  • 4
  • 32
  • 37
1
vote
1 answer

JNA: Pointer to a pointer to a struct

I have a function call: long foo(mystruct **list) where the definition of mystruct is typedef struct { otherstruct *bar[64]; } mystruct; and I'm trying to get at the (JNA) Structure[] corresponding to bar. My current function definition is…
Andy Shulman
  • 1,895
  • 3
  • 23
  • 32
1
vote
0 answers

JNAerator generates method with __stdcall return value

I'm currently struggling to generate a JNA wrapper for a DLL that I have to use. The DLL and the corresponding .h files are provided by IBM (Spectrum Protect aka Tivoli Storage Manager or ADSTAR) and for the life of me, I cannot use JNAerator…
Roman
  • 41
  • 5
1
vote
1 answer

How to use BridJ in 32 bit mode in 64 bit application?

I'm trying to use BridJ in a way that I'm not sure whether it is supported: I have a 64 bit application. I get a byte array containing the memory of a 32 bit application through a debugger interface. I'd like to use BridJ to parse the content of…
Lii
  • 11,553
  • 8
  • 64
  • 88
1
vote
1 answer

Platform differences reading byte values using JNA

I have created a JavaFX application to retrieve data from a FTDI peripheral device. I used JNAerator to generate the the API and everything works beautifully on my development machine (OS X). However, when tested on a coworker's box (Windows), the…
Jonathon
  • 73
  • 8
1
2 3