Questions tagged [bridj]

A Java / native interoperability library that focuses on speed and ease of use.

BridJ is a / native interoperability library that focuses on speed and ease of use. It allows Java code to call , and libraries from as if it was calling Java code.

22 questions
6
votes
1 answer

In Java and using Bridj, how can you dynamically invoke any native function?

Often users of Clojure wish to be as lazy as possible, and delay the creation of classes and objects. In that same spirit, if I wish to invoke a native function which is resolved during runtime from within Java, I can use…
bmillare
  • 4,183
  • 2
  • 23
  • 42
3
votes
1 answer

BridJ: Failed to get address of method

BridJ can not find the methods of a shared library. I need help with understanding why. The library was generated by JNAerator. mn -g of lib.so: w _Jv_RegisterClasses U _Unwind_Resume@@GCC_3.0 00004970 T _Z11CreateClassv 00004960 T…
davydes
  • 105
  • 9
2
votes
1 answer

How to properly cache Bridj JNI objects in Java/Scala

I'm looking for some guidelines on caching and reusing Bridj JNI objects between multiple JNI calls. I found that caching JNI objects vastly speeds up calling C functions over JNI but it also causes some numerical stability issues. Basically,…
2
votes
1 answer

Is it somehow possible to get a HWND of a JavaFX window in Java 9?

Java 9 will restrict any access to private API. That means that the known methods of retrieving the window hwnd using Reflection won't work anymore. Is there still a way to get them? I ask because I have a library that offers an API for manipulating…
SirWindfield
  • 117
  • 2
  • 8
2
votes
1 answer

BridJ - Pointer.pointerToAddress(long peer) has been deprecated

There is an example called TaskbarListDemo.java in BridJ repo on GitHub. When I try to compile in Netbeans with the .jar library downloaded from Maven (version 0.7.0), the method Pointer.pointerToAddress(long peer) used in this example in line 100…
Cristiam Mercado
  • 573
  • 12
  • 34
2
votes
1 answer

Segmentation faults in JNA/BridJ etc

I've rebuilt my Java/C++ project several times using JNI, JNA, BridJ, and JavaCPP, and every time I encounter random (unpredictable) segmentation faults. I have verified that a pure-C++ executable using this library never causes segmentation faults,…
Jim Pivarski
  • 5,568
  • 2
  • 35
  • 47
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
1
vote
2 answers

Bridj no longer working for Windows taskbar loading

I've been using code to make the taskbar icon of my Java application have a loading bar feature which is native to Windows 7+ applications. The code I use is the following: import lombok.val; import org.bridj.Pointer; import…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
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
0 answers

BridJ callback from Native to Java: Is it possible that values in native are overriden?

I want to write a Java wrapper to a native library (with BridJ). The method I want to wrap takes a struct of operations (callbacks): typedef struct _operations { int (*op1) (int, ...); int (*op2) (float, ...); } operations; int…
S1lentSt0rm
  • 1,989
  • 2
  • 17
  • 28
1
vote
1 answer

UsatisfiedLinkError while using BridJ with Android

Currently I am using BRIDj-0.6.1-android.jar for Android. The problem is that the library shows an unsatisfied link error as follows: 09-27 17:51:58.740: E/AndroidRuntime(12589): Caused by: java.lang.ExceptionInInitializerError 09-27 17:51:58.740:…
1
vote
2 answers

JNAerator - using interfaces generated by typedef

I'm trying to use a generated interface by JNAerator from a typedef instruction, but I can't find a way to do that: The function in the .h file is: MyClass::Initialize(LPCWSTR path); The header file also includes the original typedef…
Andrei F
  • 4,205
  • 9
  • 35
  • 66
0
votes
1 answer

Loading external dll with bridj is not possible due to hebrew username

I tried to load native library (lib.dll) to Java application via BridJ on Windows 7, where username is written in Hebrew. What is important is that the Java application downloads lib.dll and save it properly in…
Kuba Wyrobek
  • 5,273
  • 1
  • 24
  • 26
0
votes
0 answers

How to create Java annotation for a fake abstract method?

I say fake because the method isn't declared as abstract, but it doesn't have an implementation. I'm trying to fix a bug introduced by using BridJ. BridJ uses a custom annotation to annotate a method inside of an Android Activity. The method has the…
Martin
  • 748
  • 7
  • 20
1
2