To execute JavaFX Application run:
mvn compile exec:java -pl {name of module} -Dexec.mainClass={name of Main Class}
If you see the following error when running mvn compile:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project lab1: An exception occured while executing the Java class. The specified mainClass doesn't contain a main method with appropriate signature.: com.project.Variant2.main([Ljava.lang.String;) -> [Help 1]
Insert that method in one of JavaFX running classes:
public static void main(String... args) {
launch();
}
After executing you can get rid of it 😊
Read some beneficial articles before exploring third lab:
To configure Java3D on Windows OS:
- Copy .jar files from lib/Java3D/1.5.1/lib/ext directory to C:\Program Files\Java\jdk-16.0.1\lib.
- Copy j3dcore-ogl.dll file from lib/Java3D/1.5.1/bin/windows to C:\Program Files\Java\jdk-16.0.1\bin.
- Copy .jar files:
(cd lib/Java3D/1.5.1/lib/ext; sudo cp j3dcore.jar j3dutils.jar vecmath.jar /usr/lib/jvm/java-16-oracle/lib)
- Copy config file:
sudo cp lib/Java3D/1.5.1/bin/linux/libj3dcore-ogl.so /usr/lib/
The following steps are common for both OS:
- File -> Project Structure -> Libraries -> New Project Library, and then select 3 .jar files from lib/Java3D/1.5.1/lib/ext.
- File -> Project Structure -> Modules -> lab4 -> Dependecies -> Add -> Library, and select library you've created in the previous step and give it the first priority like shown in screen:
- Run program