db46 Java error while trying to install ffmpeg via macports

Today, I tried to do a ‘sudo port selfupdate’ and ‘sudo port upgrade outdated’. I say ‘tried’ because it failed when it tried to upgrade db46:

--->  Configuring db46
Error: db46 requires the Java for Mac OS X development headers.
Error: Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719>
Error: Target org.macports.configure returned: missing Java headers


So I opened that link just to see that I need a developer account to be able to log in and download. On reading the error message the second time, I noticed that it said “missing Java headers”. Searching the web for both this message and a few other keywords like macports and db46, I found the solution: You have to symlink the actual headers directory to another dir (this is not done with the current Java version I guess):

HEADERS=System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers
sudo ln -s /Developer/SDKs/MacOSX10.6.sdk/$HEADERS /$HEADERS

So I checked for the first directory being there and linked it to the other place. Now db46 built correctly and I can use ffmpeg again \o/

10 Comments

  1. Was just trying to install wine and I ran into the same problem. Your solution worked like a charm, thanks =)

  2. Thanks for this tip. I encountered this error while trying to “sudo port install git-core” and making a symlink sure saves a lot of time over having to register as an Apple developer, dig up my credentials, and download some files that I already have!

  3. Thanx a million! Otherwise my brand new MacBook Pro would have been a useless piece of aluminum…

  4. Just wanted to install git-core with mac ports. Same error here.
    That solution above also worked for me. Thanks a lot! =)

Leave a Reply

Your email address will not be published. Required fields are marked *