16

I have an issue on hdpi with netbeans, the icon become too small when I open it. Then I found the issue below. And someone says that jdk9 fix the resolution problem.

https://netbeans.org/bugzilla/show_bug.cgi?id=252452

Here is my environment:

  • OS: windows 10 (64bit)
  • JDK: JDK9 BUILD149
  • netbeans 8.2

I downloaded jdk9 & netbeans8.2 on windows10, hoping that JDK9 might fix the annoying resoution issue. Unfortunately, I can't open the netbeans.

After I type this in cmd. netbeans.exe --jdkhome "C:\Program Files\Java\jdk-9" console show the error.


No way to find original stream handler for jar protocol
java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.net.URLStreamHandler java.net.URL.handler accessible: module java.base does not "opens java.net" to unnamed module @4973813a
        at java.base/jdk.internal.reflect.Reflection.throwInaccessibleObjectException(Reflection.java:427)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:201)
        at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:171)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:165)
        at org.netbeans.ProxyURLStreamHandlerFactory.register(ProxyURLStreamHandlerFactory.java:82)
        at org.netbeans.JarClassLoader.(JarClassLoader.java:141)
        at org.netbeans.MainImpl.execute(MainImpl.java:178)
        at org.netbeans.MainImpl.main(MainImpl.java:85)
        at org.netbeans.Main.main(Main.java:83)

Does anyone know how to use jdk9 with Netbeans ?

brandboat
  • 195
  • 1
  • 1
  • 9
  • 3
    For that particular error you can just try to add `--add-opens java.base/java.net=ALL-UNNAMED` to your java command line – Stefan Zobel Dec 19 '16 at 20:36
  • 2
    Another thing to try would be using Java 9 build 147 (or older). This breaking change has been introduced in build 148. See [here](http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-November/005276.html) for the announcement and some background. – Stefan Zobel Dec 19 '16 at 20:46
  • @StefanZobel Do you know where to download the Java 9 build 147 ? I can't find any JDK which version is older then 149 in the official website. – brandboat Dec 19 '16 at 20:59
  • http://www.java.net/download/java/jdk9/archive/147/binaries/jdk-9-ea+147_windows-x64_bin.exe – Stefan Zobel Dec 19 '16 at 21:09
  • @StefanZobel, thx a lot. But I still can't use JDK 9 147 to open netbeans 8.2, so I change netbeans to [this version](http://bits.netbeans.org/download/trunk/nightly/2016-12-19_00-01-33/), and it works like a charm. – brandboat Dec 20 '16 at 07:24

2 Answers2

6

As you noted yourself in a comment you need to use one of the nightly builds to get JDK 9 support. The full instructions are available here: http://wiki.netbeans.org/JDK9Support

SpacemanSpiff
  • 249
  • 7
  • 17
0

You must update JAVA_HOME environment variable to correct path