From owner-freebsd-java@freebsd.org Sun Aug 9 19:28:05 2015 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432CA99DD3D for ; Sun, 9 Aug 2015 19:28:05 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (gerbercreations.com [71.39.140.16]) by mx1.freebsd.org (Postfix) with ESMTP id EDD60EE6 for ; Sun, 9 Aug 2015 19:28:04 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.15.2/8.15.2) with ESMTP id t79JQmcL077930; Sun, 9 Aug 2015 12:26:48 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.15.2/8.15.2/Submit) id t79JQlTk077925; Sun, 9 Aug 2015 12:26:47 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Sun, 9 Aug 2015 12:26:47 -0700 From: Greg Lewis To: Alex de Kruijff Cc: freebsd-java@freebsd.org Subject: Re: OpenJDK8 SUNWprivate_1.1 bug with sun.nio.fs.DefaultFileSystemProvider.create() Message-ID: <20150809192647.GA99038@misty.eyesbeyond.com> References: <55C47572.4070907@dds.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C47572.4070907@dds.nl> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Aug 2015 19:28:05 -0000 On Fri, Aug 07, 2015 at 11:08:02AM +0200, Alex de Kruijff wrote: > I've found a bug for the native OpenJDK8. When a > DefaultFileSystemProvider is being created an UnsatisfiedLinkError is > thrown. This problem does not happen on Windows or FreeBSD/OpenJDK7. > > So each of the following lines of code > > java.nio.file.spi.FileSystemProvider provider = > > sun.nio.fs.DefaultFileSystemProvider.create(); > > java.nio.file.FileSystem aDefault = > > java.nio.file.FileSystems.getDefault(); > > java.nio.file.Path path = new java.io.File("test", ".").toPath(); > > results in the exception > > java.lang.UnsatisfiedLinkError: > > /usr/local/openjdk8/jre/lib/amd64/libnio.so: > > /usr/local/openjdk7/jre/lib/amd64/libnet.so: version SUNWprivate_1.1 > > required by /usr/local/openjdk8/jre/lib/amd64/libnio.so not defined If that is the actual output then it looks like you're doing something very strange, since you have native libraries from both openjdk8 and openjdk7 listed there. They won't work together like that. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org From owner-freebsd-java@freebsd.org Mon Aug 10 18:39:18 2015 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A9D99E661 for ; Mon, 10 Aug 2015 18:39:18 +0000 (UTC) (envelope-from akruijff@dds.nl) Received: from smtpgw.dds.nl (smtpgw.dds.nl [91.142.252.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1211EB for ; Mon, 10 Aug 2015 18:39:17 +0000 (UTC) (envelope-from akruijff@dds.nl) Received: from [192.168.1.2] (195-241-24-75.ip.open.net [195.241.24.75]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtpgw.dds.nl (Postfix) with ESMTPSA id 1E24C7F48A; Mon, 10 Aug 2015 20:39:07 +0200 (CEST) Message-ID: <55C8EFCB.10601@dds.nl> Date: Mon, 10 Aug 2015 20:39:07 +0200 From: Alex de Kruijff User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Greg Lewis CC: freebsd-java@freebsd.org Subject: Re: OpenJDK8 SUNWprivate_1.1 bug with sun.nio.fs.DefaultFileSystemProvider.create() References: <55C47572.4070907@dds.nl> <20150809192647.GA99038@misty.eyesbeyond.com> In-Reply-To: <20150809192647.GA99038@misty.eyesbeyond.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.98.7 at smtpgw.dds.nl X-Virus-Status: Clean X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2015 18:39:18 -0000 On 09-08-2015 21:26, Greg Lewis wrote: > On Fri, Aug 07, 2015 at 11:08:02AM +0200, Alex de Kruijff wrote: >> I've found a bug for the native OpenJDK8. When a >> DefaultFileSystemProvider is being created an UnsatisfiedLinkError is >> thrown. This problem does not happen on Windows or FreeBSD/OpenJDK7. >> >> So each of the following lines of code >>> java.nio.file.spi.FileSystemProvider provider = >>> sun.nio.fs.DefaultFileSystemProvider.create(); >>> java.nio.file.FileSystem aDefault = >>> java.nio.file.FileSystems.getDefault(); >>> java.nio.file.Path path = new java.io.File("test", ".").toPath(); >> results in the exception >>> java.lang.UnsatisfiedLinkError: >>> /usr/local/openjdk8/jre/lib/amd64/libnio.so: >>> /usr/local/openjdk7/jre/lib/amd64/libnet.so: version SUNWprivate_1.1 >>> required by /usr/local/openjdk8/jre/lib/amd64/libnio.so not defined > If that is the actual output then it looks like you're doing something > very strange, since you have native libraries from both openjdk8 and > openjdk7 listed there. They won't work together like that. > I later realized what was going on. It seems to be bug in NetBeans. I did furter testing and everything was fine on the command line. I'm sorry to have waisted you time. From owner-freebsd-java@freebsd.org Mon Aug 10 18:54:57 2015 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F72999E9F7 for ; Mon, 10 Aug 2015 18:54:57 +0000 (UTC) (envelope-from akruijff@dds.nl) Received: from smtpgw.dds.nl (smtpgw.dds.nl [91.142.252.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D700FAA3 for ; Mon, 10 Aug 2015 18:54:56 +0000 (UTC) (envelope-from akruijff@dds.nl) Received: from [192.168.1.2] (195-241-24-75.ip.open.net [195.241.24.75]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtpgw.dds.nl (Postfix) with ESMTPSA id 181317F489; Mon, 10 Aug 2015 20:54:52 +0200 (CEST) Message-ID: <55C8F37C.6020904@dds.nl> Date: Mon, 10 Aug 2015 20:54:52 +0200 From: Alex de Kruijff User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: tzezula@netbeans.org, Alfatrion@netbeans.org CC: freebsd-java@freebsd.org Subject: Re: [Bug 254210] Running application build for Java8 fails because it looks for Java7 References: In-Reply-To: X-Virus-Scanned: clamav-milter 0.98.7 at smtpgw.dds.nl X-Virus-Status: Clean Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2015 18:54:57 -0000 I've included the java list from FreeBSD. On 10-08-2015 15:42, tzezula@netbeans.org wrote: > https://netbeans.org/bugzilla/show_bug.cgi?id=254210 > > Tomas Zezula changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|NEW |RESOLVED > Resolution|--- |INCOMPLETE > Target Milestone|TBD |8.1 > > --- Comment #2 from Tomas Zezula --- > Seems as a problem of the JDK 1.7.0_80 on BSD. > The IDE does not set java.library.path unless the user does it in the project > properties. The default value of the java.library.path should be taken from the > ${DYLD_LIBRARY_PATH} and extended by the VM. It seems that for some reason the > DYLD_LIBRARY_PATH contains the /usr/local/openjdk7/jre/lib/amd64. > > Unfortunately I cannot verify as I don't have FreeBSD, can you execute the > following Java code both in NetBeans and command line using JDK 7 and attach > the output: > > public static void main(String[] args) { > System.out.printf("java.version = %s%n", System.getProperty("java.version")); > System.out.printf("java.library.path = %s%n", > System.getProperty("java.library.path")); > System.out.printf("DYLD_LIBRARY_PATH = %s%n", > System.getenv("DYLD_LIBRARY_PATH")); > } > > Also the shell echo ${DYLD_LIBRARY_PATH} is needed. > Thanks > > > You can resolve the problem by adding the following VM Option into > Project/Properties/Run: > > -Djava.library.path=/usr/local/lib *My original code works if I do this**:* --------------------------------------------------- cd /usr/local/openjdk7/jre/lib/amd64; mv libnet.so libnet.so.bak; ln -sv /usr/local/openjdk8/jre/lib/amd64/libnet.so Then it works. Of course now thereis a problem with JDK7 projects. *The output you requested:* --------------------------------------------------- java.version = 1.8.0_51 java.library.path = /usr/local/openjdk7/jre/lib/amd64:/usr/local/openjdk7/jre/lib/i386::/usr/local/lib DYLD_LIBRARY_PATH = null *And the result of -Djava.library.path=/usr/local/lib* --------------------------------------------------- No. I've tried al kinds of stuff with this option. I get the same exception again: Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/openjdk8/jre/lib/amd64/libnio.so: /usr/local/openjdk7/jre/lib/amd64/libnet.so: version SUNWprivate_1.1 required by /usr/local/openjdk8/jre/lib/amd64/libnio.so not defined I've also tried: -Djava.library.path=/usr/local/openjdk8/jre/lib/amd64:/usr/local/openjdk8/jre/lib/i386::/usr/local/lib And: -Djava.library.path=/usr/local/openjdk8/jre/lib/amd64 But that also doesn't work. Same exception. P.S. Using the VM option is hard for Maven projects Alex