Trouble with setting up jnigen

Anything libgdx related goes here!

Trouble with setting up jnigen

Postby Bantay » Fri Jan 17, 2020 8:21 am

Hello everyone,,
I was trying to setup jnigen to integrate some performance critical code.
So far I had mingw and ant installed with their bin folder included in the PATH, i have also ANT_HOME pointing to my ant directory.
mobdro lucky patcher kodi
I was trying a simple tutorial, the one which Mario was demonstrating https://www.youtube.com/watch?v=N2EE_jlDfrM.
When running the script i am getting a successful build, but unfortunately the ant script isn't generating any libraries (dll for windows 32 in this example). After looking at the output log i noticed that ant isn't finding the compiler g++ which is pointed by the PATH variable.

I am using Eclipse IDE for Java Developers
Version: Oxygen.1a Release (4.7.1a)

Any suggestions? Thank you all.

Here is my log output:

Code: Select all
C/C++ for 'src/jnigentest/Adder.java' up to date
Wrote target 'Windows' build script 'jni\build-windows32.xml'
Wrote master build script 'jni\build.xml'
Executing 'ant.bat -f "C:\Users\COMP\eclipse-workspace\jnigentest\jni\build.xml" -v'
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8.0_144\lib\tools.jar
Apache Ant(TM) version 1.9.9 compiled on February 2 2017
Buildfile: C:\Users\COMP\eclipse-workspace\jnigentest\jni\build.xml
Detected Java version: 1.8 in: C:\Program Files\Java\jre1.8.0_144
Detected OS: Windows 7
parsing buildfile C:\Users\COMP\eclipse-workspace\jnigentest\jni\build.xml with URI = file:/C:/Users/COMP/eclipse-workspace/jnigentest/jni/build.xml
Project base dir set to: C:\Users\COMP\eclipse-workspace\jnigentest\jni
Build sequence for target(s) `all' is [compile-natives, pack-natives, all]
Complete build sequence is [compile-natives, pack-natives, all, clean, ]

compile-natives:
parsing buildfile jar:file:/C:/apache-ant-1.9.9/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/apache-ant-1.9.9/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
Project base dir set to: C:\Users\COMP\eclipse-workspace\jnigentest\jni
      [ant] calling target(s) [default] in build file C:\Users\COMP\eclipse-workspace\jnigentest\jni\build-windows32.xml
parsing buildfile C:\Users\COMP\eclipse-workspace\jnigentest\jni\build-windows32.xml with URI = file:/C:/Users/COMP/eclipse-workspace/jnigentest/jni/build-windows32.xml
Project base dir set to: C:\Users\COMP\eclipse-workspace\jnigentest\jni
 [property] Loading Environment env.
      [ant] Entering C:\Users\COMP\eclipse-workspace\jnigentest\jni\build-windows32.xml...
Build sequence for target(s) `postcompile' is [precompile, create-build-dir, compile, link, postcompile]
Complete build sequence is [precompile, create-build-dir, compile, link, postcompile, clean, ]

precompile:
Property "env.Path" has not been set
Property "env.Path" has not been set
[available] Searching C:\Program Files\Java\jre1.8.0_144\bin\server
[available] Searching C:\Program Files\Java\jre1.8.0_144\bin
[available] Searching C:\Program Files\Java\jre1.8.0_144\lib\amd64
[available] Searching C:\ProgramData\Oracle\Java\javapath
[available] Searching C:\Program Files (x86)\QuickTime\QTSystem
[available] Searching C:\Program Files (x86)\Java\jdk1.8.0_131\bin
[available] Searching C:\Program Files (x86)\Java\jdk1.8.0_131\include
[available] Searching C:\Program Files (x86)\Java\jdk1.8.0_131\include\win32
[available] Searching C:\Program Files (x86)\GtkSharp\2.12\bin
[available] Searching C:\Program Files (x86)\Skype\Phone
[available] Searching C:\Windows\System32
[available] Searching C:\MinGW\bin
[available] Searching C:\mingw64\bin
[available] Searching C:\apache-ant-1.9.9\bin
[available] Searching C:\windows\system32
[available] Unable to find g++
[available] Searching C:\Users\COMP\eclipse-workspace\jnigentest\jni\${env.Path}
[available] Unable to find g++
Property "compiler-found" has not been set

create-build-dir:
Skipped because property 'has-compiler' not set.

compile:
Skipped because property 'has-compiler' not set.

link:
Skipped because property 'has-compiler' not set.

postcompile:
      [ant] Exiting C:\Users\COMP\eclipse-workspace\jnigentest\jni\build-windows32.xml.

pack-natives:
      [jar] No Implementation-Title set.No Implementation-Version set.No Implementation-Vendor set.
      [jar] Location: C:\Users\COMP\eclipse-workspace\jnigentest\jni\build.xml:13:

all:

BUILD SUCCESSFUL
Total time: 0 seconds
Last edited by Bantay on Tue Jan 21, 2020 5:06 pm, edited 2 times in total.
Bantay
 
Posts: 2
Joined: Fri Jan 17, 2020 8:19 am

Re: Trouble with setting up jnigen

Postby shatterblast » Fri Jan 17, 2020 2:56 pm

A) I would assume it's not because of your Windows 7 copy. Still, 7 just completely expired. You might want to get BitDefender Free if you can for Anti-virus if you don't plan on upgrading. Most Anti-virus if not all will drop support for 7.
B) What modules do you include? Do you have Android in your list at all?
C) Why not try Java 11? You might need it with Gradle for the recent version of LibGDX.

As long as you are not trying to build for either iOS or Android on Eclipse, I think you will be fine for the most part. If you try to build without those and still fail, then you need to change something.

And of course for the usual question.... What version of LibGDX are you using?
shatterblast
 
Posts: 653
Joined: Sun Jul 06, 2014 1:14 pm


Return to Libgdx

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest