Netbeans 8.2 with jdk 9
Asked Answered
M

2

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 ?

Monosyllable answered 19/12, 2016 at 20:28 Comment(5)
For that particular error you can just try to add --add-opens java.base/java.net=ALL-UNNAMED to your java command lineInfliction
Another thing to try would be using Java 9 build 147 (or older). This breaking change has been introduced in build 148. See here for the announcement and some background.Infliction
@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.Monosyllable
java.net/download/java/jdk9/archive/147/binaries/…Infliction
@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, and it works like a charm.Monosyllable
A
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

Aristate answered 14/3, 2017 at 16:4 Comment(0)
T
0

You must update JAVA_HOME environment variable to correct path

Thicken answered 9/12, 2017 at 21:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.