This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 234311 - Cannot create a new Java platform
Summary: Cannot create a new Java platform
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 7.4
Hardware: All Unix
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-13 09:37 UTC by Jan Lahoda
Modified: 2013-08-20 12:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed fix. (1012 bytes, patch)
2013-08-14 09:48 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2013-08-13 09:37:00 UTC
IDE info:
---
Product Version: NetBeans IDE Dev (Build 201307102300)
Updates: Updates available
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: SunOS version 5.11 running on x86; UTF-8; en_US (nb)
User directory: /tmp/nbuser
Cache directory: /tmp/nbuser/var/cache
---

Cannot create a new Java platform (Tools/Java Platforms) for a 1.8 JDK, with error "Cannot detect and install the selected platform. The java or javac may not be executable".

The problem is that the launcher sets the LD_LIBRARY_PATH to point to the IDE's JDK, and on Solaris LD_LIBRARY_PATH is used before looking into the binary's RPATH, and so the JDK8 tries to use libraries from JDK7, which fails.

I'll attach a proposed patch soon - it changes the LD_LIBRARY_PATH on Solaris so that the 'emergency brake' defined by:
http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d8dfd1a0bd8d
is triggered, which sets the LD_LIBRARY_PATH in the launcher to correct values (at the cost of a minimal slowdown).

As a side note, setting the LD_LIBRARY_PATH is unnecessary on JDK8, due to:
http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f003387c33ad
Comment 1 Jan Lahoda 2013-08-14 09:48:23 UTC
Created attachment 138675 [details]
Proposed fix.
Comment 2 Libor Fischmeistr 2013-08-19 09:09:20 UTC
Thank you for the patch. I've verified it on Solaris. Unfortunately I found out that the same problem occurs on Linux and MacOS. But there the patch doesn't help (of course when I removed the case statement).

I would ask you to help with these two platforms.
Comment 3 Libor Fischmeistr 2013-08-20 12:31:58 UTC
Patch applied: http://hg.netbeans.org/core-main/rev/f1a4f6ec5353

Thanks for it and sorry for misunderstood with 32bit jdk on 64bit systems - missing library.