Cloning JTegraNX includes everything you need to build it, all you need is Maven.
- Clone JTegraNX.
- Open a command prompt or terminal window and navigate to where JTegraNX was cloned.
- Run
mvn -B -DskipTests clean package
.
You only need to build the natives if you've made changes to their code.
The Windows natives are made from a Visual Studio 2019 project linked with libusbK 3.0.7.0.
- Create a new Visual Studio Solution (Dynamic Link Library) and name it JTegraNX.
- Open the project's properties -> C/C++ -> Precompiled headers, and set "Precompiled Header" to "Not Using Precompiled Headers" and clear the "Precompiled Header File" field.
- In C/C++ -> General -> Additional Include Directories, add the include directories for JNI ((JDK Path)\include and (JDK Path\include\win32)) and libusbK (default is C:\libusbK-dev-kit\includes) and apply.
- Switch platform to x64.
- In Linker -> General -> Additional Library Directories, add C:\libusbK-dev-kit\bin\dll\amd64 if that's where you installed the libusbK-dev-kit and apply.
- Switch platform to Win32.
- In Linker -> General -> Additional Library Directories, add C:\libusbK-dev-kit\bin\lib\x86 if that's where you installed the libusbK-dev-kit and apply.
- Switch platform to All Platforms.
- In Linker -> Input -> Additional Dependencies, add SetupAPI.lib and libusbK.lib.
- Delete "framework.h", "pch.h", "dllmain.ccp", and "pch.cpp" from the project.
- Copy the Native's source files from this repository to the directory of the Visual Studio Project.
- Copy libusbK.dll from the libusbK-dev-kit to the directory of the Visual Studio Project.
- In the Solution Explorer, right click on Header Files and select Add -> Existing Item... and add all the header files.
- In the Solution Explorer, right click on Source Files and select Add -> Existing Item... and add all the source files.
- Build the Release configuration of both platforms.
- Copy the compiled x86 native to
src\main\resources\native\windows
and rename it to "JTegraNX_x86.dll". - Copy the compiled x64 native to
src\main\resources\native\windows
and rename it to "JTegraNX_x64.dll".
- Edit the makefile to have the proper paths for JNI.
- Run
make
. - Copy the compiled x86 native to
src\main\resources\native\linux
and rename it to "JTegraNX_x86.so". - Copy the compiled x64 native to
src\main\resources\native\linux
and rename it to "JTegraNX_x64.so".
Mac OS X doesn't need a native since fusee-gelee works out of the box with it.