Hot questions for Using Ubuntu in netbeans

Question:

Netbeans was installed using the ubuntu software manager.

The instructions on the netbeans website for setting up a maven project in netbeans are the following:

  1. Choose File > New Project (Ctrl-Shift-N) to open the New Project wizard.
  2. Select NetBeans Application from the Maven category:

But the maven category is not there on my installation.

Also on the website:

  1. Select the Miscellaneous category in the Options window and click the Maven tab.

But there is no maven tab at all. What's the reason for maven not being there, and how can I get it working?

Thanks!


Answer:

You have to install the maven plugin inside Netbeans.

Go in the menu Tools -> Plugins

In the Available plugins section, select the Maven plugin from the Java SE category and install it. You can use the search box to find it easily.

Question:

I am currently using Ubuntu as my OS. I need to include the Weka API javadoc in my Netbeans IDE installation. How can I do this ?


Answer:

Here is the steps of adding Weka API Javadoc to NetBeans IDE:

  1. Right click on the project -> Properties -> Libraries
  2. Select the library to which you want to add javadoc
  3. Click the Edit button and from there you can Browse javadoc folder.

The Javadoc folder of Weka is in the installation directory of Weka-X-X (i.e ~/Weka-3-6).

Question:

Good morning/afternoon/night! (as applies)

Today I tried to test my new learned skills in Java, from Windows 10 to Ubuntu 19.4 (freshly installed) using NetBeans 8.2 (same version in both OS's), and in my first compilation for the sample JavaFX application (I mean, a new "empty" project), I got an error can't solve.

ant -f /home/felipe/NetBeansProjects/demoJavaFXApp jfxsa-run
init:
Deleting: /home/felipe/NetBeansProjects/demoJavaFXApp/build/built-jar.properties
deps-jar:
Updating property file: /home/felipe/NetBeansProjects/demoJavaFXApp/build/built-jar.properties
compile:
Detected JavaFX Ant API version 1.3
jfx-deployment:
jar:
Copying 12 files to /home/felipe/NetBeansProjects/demoJavaFXApp/dist/run309629545
jfx-project-run:
Executing /home/felipe/NetBeansProjects/demoJavaFXApp/dist/run309629545/demoJavaFXApp.jar using platform /usr/local/jdk1.8.0_111/jre/bin/java
Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException: 
file:/home/felipe/NetBeansProjects/demoJavaFXApp/dist/run309629545/demoJavaFXApp.jar!/mx/com/tiammatsoftware/demoJavaFXApp/FXMLDocument.fxml:9
    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
    at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:103)
    at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:922)
    at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:971)
    at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:220)
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:744)
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
    at mx.com.tiammatsoftware.demoJavaFXApp.DemoJavaFXApp.start(DemoJavaFXApp.java:22)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)
    ... 1 more
Caused by: java.lang.ClassNotFoundException: demojavafxapp.FXMLDocumentController
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:920)
    ... 22 more
Exception running application mx.com.tiammatsoftware.demoJavaFXApp.DemoJavaFXApp
Java Result: 1
Deleting directory /home/felipe/NetBeansProjects/demoJavaFXApp/dist/run309629545
jfxsa-run:
BUILD SUCCESSFUL (total time: 1 second)

Searched in The Net about that error and aparently is quite rare, 'cause found nothing.

Thanks in advance for any help provided.


Answer:

Looks like FXMLDocument.fxml refers to demojavafxapp.FXMLDocumentController while you seems to use mx.com.tiammatsoftware.demoJavaFXApp package. Probably correct class name should be mx.com.tiammatsoftware.demoJavaFXApp.FXMLDocumentController.