This repository was archived by the owner on Jan 4, 2023. It is now read-only.
This repository was archived by the owner on Jan 4, 2023. It is now read-only.
installation: make error Ubuntu 18.04 #163
Open
Description
I'm trying to install tinyb on my PC (ubuntu 18.04 os) but I receive this error during the make command:
Generating JNI headers..
Error: Could not find class file for 'tinyb.BluetoothAdapter'.
java/CMakeFiles/tinybjar.dir/build.make:93: recipe for target 'tinybjar' failed
make[2]: *** [tinybjar] Error 1
CMakeFiles/Makefile2:87: recipe for target 'java/CMakeFiles/tinybjar.dir/all' failed
make[1]: *** [java/CMakeFiles/tinybjar.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I've searched in the folders and the .class files are in that position so I cannot understand why I have this issue. Could you help me?
Activity
bwssytems commentedon May 6, 2019
I second this as I have this error as well. I made sure to build the cpp side first and install that then turn the java binding on and compile and get the same as above on Linux Mint 19.1:
#root@/git/tinyb/build# make
Scanning dependencies of target tinybjar
[ 2%] Building Java objects for tinybjar.jar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[ 4%] Generating CMakeFiles/tinybjar.dir/java_class_filelist
[ 6%] Creating Java archive tinyb.jar
Generating JNI headers..
Error: Could not find class file for 'tinyb.BluetoothAdapter'.
java/CMakeFiles/tinybjar.dir/build.make:93: recipe for target 'tinybjar' failed
make[2]: *** [tinybjar] Error 1
CMakeFiles/Makefile2:87: recipe for target 'java/CMakeFiles/tinybjar.dir/all' failed
make[1]: *** [java/CMakeFiles/tinybjar.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
bwssytems commentedon May 7, 2019
So went through a lot of tries on building and determined that javah is not working in 1.8 or above. Switched to Java 11 and changed the cmake to use javac -h instead. Had to have the CMakeLists.txt to make it work though. but now have the library. Here is the updated CMakeLists.txt that needs to be updated in the java directory before you run
sudo cmake -DBUILDJAVA=ON ..
mpbarnwell commentedon Jun 25, 2019
I was able to overcome this issue by explicitly setting the JAVA_HOME environmental variable then re-running cmake:
The output for those interested:
gpietro commentedon Jun 16, 2020
@bwssytems I did try your solution without success... (I'm running Java 11 on raspberry pi 3)
@mpbarnwell also tired setting Java 8 with
/usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java
but it couldn't find the class.😭
davidzof commentedon Sep 18, 2020
@gpietro Worked ok for me with a Java 8 JDK. No go with Java 11.
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
cd build
cmake .. -DBUILDJAVA=ON -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
on Ubuntu 18.4
a333klm commentedon Nov 20, 2020
#164 might solve this.
franciscomirasg commentedon Apr 30, 2021
Hi,
I follow the instruction above but I am getting this error
log.txt
On Ubuntu 20.04
AntistesSacrorum commentedon May 4, 2021
Make sure you have jdk and not just jre. BTW you don't need to install it, just download an archive from here, for example: https://adoptopenjdk.net/releases.html and extract to some folder.
One more point, make sure you have cmake v3.11 and above versions below doesn't support java 10+ (javah was replaced by javac -h")
dejanovicnnd-symphony commentedon Jan 27, 2022
Hello there!
I still cannot understand how am I missing this file
tiny_BluetoothAdapt.h
somake
is not succeeding.. Also, where is this header file coming from?I get this:
bwssytems commentedon Mar 31, 2022
So updating what works for me now that I had to go back and use tinyb again:
OpenJdk 1.11
Linux Mint 20.3 Una
cmake version 3.16.3
GNU Make 4.2.1
running from the clone from git and following the build instructions for Java
Change the file java/CMakeLists.txt to this and replace to the actual path
Need to Change Java file java/BluetoothManager.java and comment out API version code like so:
victorex27 commentedon Apr 4, 2022
Worked for me. After so many days of stress. Thanks.