I'm new to Java and Netbeans. I'm trying to import a library but all the instructions I've found online either reference a "Library" folder in the Netbeans project, or a "Library" tab when right-clicking the project and selecting "Properties". I'm using Netbeans 12 on MacOs and neither of those exist when I create a new "Java Application" project.
I have the .jar files. I have tried Tools > Library > New Library > Add JAR / Folder, and included the whole directory, but I get this error when trying to Run from NetBeans:
package com.trolltech.qt.gui does not exist
When I include the .jar files them in the base directory of the application and compile from the command line as described below they are imported and the application runs as expected.
$ javac -cp qtjambi-4.8.6.jar:qtjambi-native-macosx-gcc-4.8.6.jar siteReviewerApp.java
$ java -XstartOnFirstThread -cp qtjambi-4.8.6.jar:qtjambi-native-macosx-gcc-4.8.6.jar siteReviewerApp.java
Here is the code of the app:
package com.me.app;
import com.trolltech.qt.gui.*;
public class App {
public static void main(String[] args){
QApplication.initialize(args);
QMessageBox.information(null, "QtJambi", "Hello World!");
QApplication.shutdown();
}
}
Here are contents of the directory:
$ ls -lah
total 70608
drwxr-xr-x 7 development staff 238B 7 Jun 11:08 .
drwxr-xr-x 3 development staff 102B 7 Jun 08:02 ..
-rw-r--r-- 1 development staff 80K 7 Jun 11:08 hs_err_pid6586.log
-rw-r--r--@ 1 development staff 3.2M 15 Nov 2014 qtjambi-4.8.6.jar
-rw-r--r--@ 1 development staff 31M 15 Nov 2014 qtjambi-native-macosx-gcc-4.8.6.jar
-rw-r--r-- 1 development staff 732B 7 Jun 11:08 App.class
-rw-r--r-- 1 development staff 801B 7 Jun 11:08 App.java
How should I import the .jar files into Netbeans 12 for MacOs?