15

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?

PolGraphic
  • 3,233
  • 11
  • 51
  • 108
  • [1] Is the `nbjavac` plugin definitely activated? To check, go to **Tools > Plugins > Installed**, search for `nbjavac`, and then verify that the **Active** column for the displayed entry for _"The nb-javac Java editing support library"_ (under the _Java_ Category) shows a green circle with a white check mark. [2] If it not activated then try to activate it. [3] Finally, restart NetBeans, and then update your question to show the content of the NetBeans log (**View > IDE Log**) immediately after the restart. – skomisa Jan 14 '20 at 03:47

5 Answers5

33

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"

Community
  • 1
  • 1
Bence Szebedy
  • 556
  • 4
  • 11
  • 2
    this one worked for me on apache 12.0 , though it didnt ask me to reinstall the plugin, i had to do it manually, but thanks – BIDS Salvaterra Nov 22 '20 at 19:52
  • 1
    This worked for me on 12.2, and I had to install manually. But this time it say v2.0 for the plugin instead of v1.0 the first time it installed. – TimGallagher Jan 19 '21 at 17:26
  • Why didn't that plugin installed earlier automatically (solved) when first time user install the Netbean itself ? Does it big or something? – gumuruh Aug 16 '21 at 03:38
5

In my case, the error occurred when I was trying to install Hibernate library and activating it in NetBeans, what I did was:

  1. Go to: http://plugins.netbeans.org/plugin/73454/nb-javac-library and download the plugin corresponding to your NetBeans version

  2. Unzip the archive then go to NetBeans: Tools -> Plugins -> Downloaded (Tab) -> Add plugins then select the .nbm files you've just unzipped

  3. Uninstall the plugin you were trying to install, restart NetBeans then reinstall the plugin you're trying to install

Mehdi Fracso
  • 448
  • 2
  • 16
  • If you're on 11.1 like me, you will find that the above link does not have a version for NB11.1. Downloading and installing the version for 11.2 will work. Thanks Mehdi Fracsco – dBlaze Mar 26 '20 at 07:30
  • @dBlaze my pleasure, I am also on version 11.2 but as I can see, netbeans isn't producing new plugins versions for the new IDE versions, like I was trying to download Struts plugin for netbeans 11.2, all the plugins that I found were meant for earlier versions ( <= V7), still that plugin for 7th version worked on my 11th version. – Mehdi Fracso Mar 29 '20 at 13:31
3

so i solved same issue by first going to C:\Users...\AppData\Roaming\NetBeans\11.2\modules folder and deleted org-netbeans-modules-nbjavac.jar.

After, I restarted Netbeans IDE. Go to:

Windows -> IDE Tools -> Notifications

to open the Notification Window and click the "It is recommended to install nb-javac Library to improve Java editing experience and enable compile on save" to reinstall the nb-javac library.

Restarted after and worked for me.

blackgreen
  • 34,072
  • 23
  • 111
  • 129
0

In my case (netbeans 11.0) the error occurs because the Plugin Portal repository does not work, what I did was:

Goto to Tools -> Plugins -> Settings

Edit the link of Plugin Portal to the correct URL as per your Netbeans installation from the following link:

https://cwiki.apache.org/confluence/display/NETBEANS/Where+to+download+plugins+for+NetBeans+10.0+and+earlier

For Netbeans 11.0 it is: http://plugins.archive.librebeans.org/catalogue/11.0/catalog.xml

  1. Go to Tools > Plugins > Available Plugins and press check for newest
  2. Search for javac to find the line "nb-javac Library"
  3. Select and install
  4. Restart NetBeans
iberck
  • 2,372
  • 5
  • 31
  • 41
-1

In my case IDE 12.1 I re-activated nb-Javac JAVA editing support library. And that NOT from File>New Projects, instead, from home page Activate Features. And then i clicked IDE log. .....it worked.......