Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not all requested modules can be enabled - org-netbeans-modules-nbjavac.jar

Tags:

java

netbeans

While working with NetBeans I have an error:

Not all requested modules can be enabled: [StandardModule:org.netbeans.modules.nbjavac jarFile: C:\Users...\AppData\Roaming\NetBeans\11.2\modules\org-netbeans-modules-nbjavac.jar]

I believe it's connected to my problem with NetBeans hints for Java not being showed.

The file exists in C:\Users\...\AppData\Roaming\NetBeans\11.2\modules\org-netbeans-modules-nbjavac.jar.

It's the only module noted as missed.

I am aware of popular problem will multiple modules noted as not possible to be enabled due to wrong JDK path. My path to JDK seems to be about right:

netbeans_jdkhome="D:\Program Files\Java\jdk1.8.0_231"

If I comment it out (as suggested in some solutions), than hints are working but project does not start because of multiple errors on TomEE (which works perfectly fine with the JDK uncommented):

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.openejb.loader.TomcatClassPath$3 (file:/D:/Programming/apache-tomee-webprofile-7.0.2/lib/openejb-loader-7.0.2.jar) to method java.net.URLClassLoader.addURL(java.net.URL) WARNING: Please consider reporting this to the maintainers of org.apache.openejb.loader.TomcatClassPath$3 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 06-Jan-2020 06:24:23.213 INFO [main] org.apache.openejb.util.OptionsLog.info Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator' 06-Jan-2020 06:24:23.230 SEVERE [main] jdk.internal.reflect.NativeMethodAccessorImpl.invoke Catalina.start org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[8005]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112) at org.apache.catalina.startup.Catalina.load(Catalina.java:606) at org.apache.catalina.startup.Catalina.load(Catalina.java:629) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)

06-Jan-2020 06:24:23.231 WARNING [main] jdk.internal.reflect.NativeMethodAccessorImpl.invoke Calling stop() on failed component [StandardServer[8005]] to trigger clean-up did not complete. org.apache.catalina.LifecycleException: Failed to stop component [StandardServer[8005]] at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:238) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:264) at org.apache.catalina.startup.Catalina.start(Catalina.java:659) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495) Caused by: org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_stop]) for component [StandardService[Catalina]] in state [INITIALIZED] at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:402) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:213) at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:812) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226) ... 8 more

Is there a way to use my JDK and use hints?

like image 639
PolGraphic Avatar asked Jan 06 '20 04:01

PolGraphic


People also ask

What is NB Javac library?

"nb-javac" is a patched version of OpenJDK "javac", i.e., the Java compiler. This has long been part of NetBeans, providing a highly tuned Java compiler specifically for the Java editor i.e., parsing and lexing for features such as syntax coloring, code completion.

How do I install NetBeans 12.2 on Windows 10?

Download NetBeans 12 Now click the Download Button to navigate to the Downloads Page of NetBeans as shown in Fig 3. I have highlighted the download options for windows using the installer. Now click the Windows Installer Link. It will open the page having download links from the mirror sites as shown in Fig 4.


1 Answers

I solved the exact same problem by reinstalling the nb-javac plugin (2.0) in my NetBeans (11.3)

  1. Open NetBeans
  2. Go to Tools > Plugins > Installed
  3. Enable checkbox "Show details"
  4. Search for javac to find the line "The nb-javac Java editing support library"
  5. Select and uninstall
  6. Restart NetBeans
  7. NetBeans will recommend installing nb-javac in an info box. Just click on the link and follow instructions

UPDATE for NetBeans 12.1 & NetBeans 12.2 This solves the error message "Cannot enable the nb-javac plugin"

like image 174
Bence Szebedy Avatar answered Oct 08 '22 19:10

Bence Szebedy