Comments (13)
I rebooted my machine and the cache issue went away. So now my build is successful!
Thanks @thatdatabaseguy.
from jpostal.
These are the relevant lines:
checking for /System/Library/Frameworks/JavaVM.framework/Versions/include/jni.h... no
configure: error: cannot find JDK header files
You'll need to find jni.h on your system and make sure it's on the C include path.
from jpostal.
It turns out that the build process is looking for the header file jni.h at /System/Library/Frameworks/JavaVM.framework/Versions/include/
directory, which doesn't exist on MacOS (Sierra). On Mac, the JDK installation has these files at /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/include/
.
Is there a way to tell the build process to look for the header files in a different location?
from jpostal.
From configure.ac, you can set JNI_INCLUDE_DIRS and they'll be added to the C include flags.
I wrote libpostal and all its bindings on a Mac (still on El Capitan though), and this shouldn't be necessary if Java/JNI is installed through XCode (Apple Developer Tools).
from jpostal.
thanks @thatdatabaseguy ! Unfortunately Java/JNI wasn't installed through XCode for me...
I did set JNI_INCLUDE_DIRS to the right directory that contains jni.h
in configure.ac
. When i ran
./gradlew assemble
I saw the same error (can't find the jni.h). Do i need to run some other scripts for it to kick in?
(I did try to run autoconf
, which generated an updated configure
file that I can see with my updates to JNI_INCLUDE_DIRS. But still got the same error when running ./gradlew assemble
)
from jpostal.
JNI_INCLUDE_DIRS is an environment variable, no need to modify configure.ac, just:
export JNI_INCLUDE_DIRS=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/include/
./gradlew assemble
If that doesn't work, I'd say overall this doesn't seem to be libpostal-related, and it's a non-standard install of Java, so Google is probably the best resource.
from jpostal.
Tried setting the variable JNI_INCLUDE_DIRS, and didn't work. Same error as before.
Don't think it is related to non-standard installation of Java. In newer version of Mac, the JDK documentation (including the .h files) was left out. For example, see:
http://stackoverflow.com/questions/9704376/how-to-install-java-native-development-headers-on-os-x-lion
Whenever you need to build JNI, you need to manually specify the jni.h file locations, see documentation from Apple website:
https://developer.apple.com/library/content/documentation/Java/Conceptual/Java14Development/05-CoreJavaAPIs/CoreJavaAPIs.html
(My java installation was fairly typical. When I ran into the jni.h issue, i went to Oracle.com, downloaded and installed JDK from there to see if it fixed the problem. It didn't).
My suspicion is that the JNI_INCLUDE_DIRS variables are not being passed to gcc compiler for some reason. Is there a place that we can add the jni.h path to gcc compiler directly?
from jpostal.
Normally you would have to specify the JNI include dir, but we use an autoconf macro that's supposed to checks most common locations for you. I just upgraded the macro to the latest version from GNU, so try pulling from master and seeing if that fixes it.
from jpostal.
@thatdatabaseguy the upgrade DID the magic. the error went away. I didn't even have to bother with setting JNI_INCLUDE_DIRS variable.
However, towards the later part of the build process (install), i got the following error:
libtool: install: ranlib /Volumes/Data/MyProjects/xcode/jlibpostal/src/main/jniLibs/libjpostal_parser.a
libtool: install: /usr/bin/install -c .libs/libjpostal_expander.a /Volumes/Data/MyProjects/xcode/jlibpostal/src/main/jniLibs/libjpostal_expander.a
libtool: install: chmod 644 /Volumes/Data/MyProjects/xcode/jlibpostal/src/main/jniLibs/libjpostal_expander.a
libtool: install: ranlib /Volumes/Data/MyProjects/xcode/jlibpostal/src/main/jniLibs/libjpostal_expander.a
make[2]: Nothing to be done for `install-data-am'.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
:compileJava
cache taskArtifacts.bin (/Volumes/Data/MyProjects/xcode/jlibpostal/.gradle/2.9/taskArtifacts/taskArtifacts.bin) is corrupt. Discarding.
FAILURE: Build failed with an exception.
* What went wrong:
Could not open cache taskArtifacts.bin (/Volumes/Data/MyProjects/xcode/jlibpostal/.gradle/2.9/taskArtifacts/taskArtifacts.bin).
> Corrupted FreeListBlock 0 found in cache '/Volumes/Data/MyProjects/xcode/jlibpostal/.gradle/2.9/taskArtifacts/taskArtifacts.bin'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 20.01 secs
I have no idea what this problem is...I did try to delete this cache folder completely and built from scratch, but got the same error.
What to do from here?
from jpostal.
Hm, can you rm -rf
the entire jpostal checkout, clone it and build again?
from jpostal.
did that. Removed the entire repo, recloned it and do the build. Got the same error.
* What went wrong:
Could not open cache taskArtifacts.bin (/Volumes/Data/MyProjects/xcode/jlibpostal/.gradle/2.9/taskArtifacts/taskArtifacts.bin).
> Corrupted FreeListBlock 0 found in cache '/Volumes/Data/MyProjects/xcode/jlibpostal/.gradle/2.9/taskArtifacts/taskArtifacts.bin'.
from jpostal.
It seems like there's some cache directory that needs to be removed as well. What is "jlibpostal"? This project is called jpostal, so assuming that's some other project for which this is a dependency, maybe that project needs a gradle clean
or something along those lines.
In any case, this seems to be solidly in Gradle territory now, and since I can't see your machine, it's better if you Google the problem and post what you find.
from jpostal.
Hi, @albarrentine I tried to build jpostal and found the same issue in this thread. I pull from the master also tried export JNI_INCLUDE_DIRS
, still seeing the configure: error: cannot find JDK header files
error. Any suggestions? Thanks a lot!
from jpostal.
Related Issues (20)
- Update for libpostal 1.0? HOT 1
- Tests failing to link HOT 3
- ./gradlew assemble HOT 3
- Is JPostal thread-safe? HOT 1
- Create a tag of the latest commit as 1.0 release? HOT 3
- Can't build jpostal HOT 2
- Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpostal_parser in java.library.path HOT 1
- Any hints how to use this lib on Android platform? HOT 2
- Deploy jpostal into an EC2 instances
- Bindings for near-duplicate detection and address deduping HOT 3
- Getting SIGSEGV on consecutive parsings
- Normalization without address expansions
- error: request for member 'language' in something not a structure or union
- libpostal logs "invalid UTF-8" warning for a string having "\0" or "\u0000" and stays in waiting state HOT 1
- jpostal in msys2 issues HOT 5
- Cannot Assemble HOT 2
- ./gradlew assemble fails due to missing file when the file clearly exists
- no jpostal_parser in java.library.path
- Build Jpostal erro on Mac OS Ventura 13.2.1 HOT 3
- C:\jpostal\src\main\jniLibs\jpostal_expander.dll: Can't find dependent libraries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpostal.