Opened 6 years ago

Closed 6 years ago

#57255 closed defect (fixed)

soprano @2.9.4: Error: soprano requires the Java for Mac OS X development headers.

Reported by: milomak Owned by: pixilla (Bradley Giesbrecht)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: mexon (Matthew Exon), jjstickel (Jonathan Stickel)
Port: soprano

Description (last modified by mf2k (Frank Schima))

when i try to install soprano, the following error presents itself:

$ sudo port install soprano
--->  Computing dependencies for soprano
--->  Configuring soprano
Error: soprano requires the Java for Mac OS X development headers.
Error: Make sure your Xcode installation is complete.
Error: Failed to configure soprano: missing Java headers
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_soprano/soprano/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port soprano failed

Java is installed:

java --version
java 11 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)

i've used installed the latest oracle jdk as well. xcode-select --install was run after the update to mojave

Attachments (1)

main.log (736.9 KB) - added by milomak 6 years ago.
main.log

Download all attachments as: .zip

Change History (21)

Changed 6 years ago by milomak

Attachment: main.log added

main.log

comment:1 Changed 6 years ago by mf2k (Frank Schima)

In the future, please use WikiFormatting.

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: pixilla removed
Description: modified (diff)
Keywords: java xcode soprano removed
Owner: set to pixilla
Status: newassigned

comment:3 Changed 6 years ago by mf2k (Frank Schima)

It looks like you only have the Java JRE installed. You need to install the JDK.

Last edited 6 years ago by mf2k (Frank Schima) (previous) (diff)

comment:4 Changed 6 years ago by milomak

I have reinstalled java. and as you can see from the below it is the jdk that is running. oracle jdk11 dmg to be specific

$ java --version
java 11 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)
$ sudo /usr/libexec/java_home -V
Matching Java Virtual Machines (1):
    11, x86_64:	"Java SE 11"	/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home

and the error still persists:

$ sudo port install soprano -x11
--->  Computing dependencies for soprano
--->  Configuring soprano
Error: soprano requires the Java for Mac OS X development headers.
Error: Make sure your Xcode installation is complete.
Error: Failed to configure soprano: missing Java headers
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_soprano/soprano/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port soprano failed
Version 0, edited 6 years ago by milomak (next)

comment:5 Changed 6 years ago by stanimura

The same error even with Java. Installing Java is not solution. The version of Java is the following:

$ sudo /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    11, x86_64:	"OpenJDK 11"	/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
    1.8.0_121, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home

The classical solution is to make symbolic link on /System/Library/Frameworks/JavaVM.framework/Headers, but it is not possbile on Mojave because of rootless system.

However, soparno is succeded to build on Mojave simply after comment out pre-configure in Portfile.

# pre-configure {
#    if {![file isfile "/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"]} {
#        ui_error "${name} requires the Java for Mac OS X development headers."
#        if {${os.major} == 11} {
#            ui_error "Download the Java Developer Package from: <http://support.apple.com/kb/DL1421>"
#        } elseif {${os.major} == 10} {
#            ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719>"
#        } elseif {${os.major} == 9} {
#            ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20720>"
#        } else {
#            ui_error "Make sure your Xcode installation is complete."
#        }
#        return -code error "missing Java headers"
#    }
# }

comment:6 Changed 6 years ago by milomak

where is the file located? @stanimura

edit - found it

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/soprano/Portfile

Last edited 6 years ago by milomak (previous) (diff)

comment:7 Changed 6 years ago by stanimura

Hi, milomak, Instead of editing Porfile directly, you can do

$ sudo port edit soprano

comment:8 Changed 6 years ago by milomak

thanks. i see it seems to use vim.

can i change it to nano?

comment:9 Changed 6 years ago by stanimura

man port

and search "edit", then you can find an example to use nano.

comment:10 Changed 6 years ago by milomak

Summary: Soprano needs Java[Solved] Soprano needs Java

comment:11 Changed 6 years ago by milomak

added the following to ~/.bash_profile

export EDITOR=nano

then ran

source ~/.bash_profile 

comment:12 Changed 6 years ago by rlhamil

This worked for me: change the line in pre-configure that looks like

     if {![file isfile "/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"]} {

to

     if {![file isfile "/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"] && ![file isfile "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h"]} {

(be sure to get all of the 2nd line). This would allow the file to be found in either location (the latter being where it is on Mojave).

comment:13 Changed 6 years ago by Liontooth (David Liontooth)

rlhamil's fix works for Mojave; how do we get it merged?

comment:14 Changed 6 years ago by mf2k (Frank Schima)

comment:15 Changed 6 years ago by mexon (Matthew Exon)

Cc: mexon added

comment:16 Changed 6 years ago by jjstickel (Jonathan Stickel)

Cc: jjstickel added

comment:17 in reply to:  14 Changed 6 years ago by jjstickel (Jonathan Stickel)

Replying to mf2k:

Submit a pull request

OR provide a patch? PRs can be a big hurdle for potentially new contributors.

Anyway, I created a PR: https://github.com/macports/macports-ports/pull/2946

comment:18 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: [Solved] Soprano needs Javasoprano @2.9.4: Error: soprano requires the Java for Mac OS X development headers.

This is still a problem, even on the buildbot workers.

comment:19 in reply to:  18 Changed 6 years ago by jjstickel (Jonathan Stickel)

Replying to ryandesign:

This is still a problem

The pull request I submitted fixes it. It just needs to be merged.

comment:20 Changed 6 years ago by jjstickel (Jonathan Stickel)

Resolution: fixed
Status: assignedclosed

In 856ef7c88cfdd12474c299b70adf4cf912a54085/macports-ports (master):

soprano: fix JDK location for mojave

Closes: #57255

Note: See TracTickets for help on using tickets.