I am working with Netbeans 8.2 and Java 8 version, when executing my program from the Netbeans IDE it runs without problem but from the command line it gives me the following error:
java -jar MiPrograma.jar
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/netbeans/lib/awtextra/AbsoluteLayout
In some forums they recommend adding the AbsoluyteLayout library to the classpath, which I select from the following path:
..\NetBeans 8.2\java\modules\ext\AbsoluteLayout.jar
I have done it this way but it keeps giving me the same error, can someone help me with this problem. Thanks.
I have encountered the same problem as you, that's why I have found your same question. Ok, I have solved it like this.
1º put the cursor on the AbsoluteLayout library in netbeans, in your project, it will tell you the path where the .jar of this library is located, go to the path and copy it.
2º unzip the entire TU .jar file in an empty folder, delete the original .jar.
3º create a lib folder (for example), if you don't have it, in the folder where you have unzipped your .jar.
4º modify the meta-inf with a notepad and add this path Class-Path: lib/AbsoluteLayout.jar
5º select your program and compress it again, in zip for example and change the extension to .jar
6th run it again!
source: https://programandoointentandolo.com/2013/04/crear-archivo-jar-en-netbeans-con-librarias-externas.html
The solution is really simple. They download the JAR file from this page ( https://es.osdn.net/projects/sfnet_printman/downloads/dist/lib/AbsoluteLayout.jar/ ) then add it like any other compressed file, it is worth mentioning that it is not necessary to uncompress, and they add it in Add JAR/Folder and the error disappears.
This is basically because the library you are working with or is by default does not support AbsoluyteLayout.
If you are using Maven for the project, the pom.xml should contain the Absolute Layout dependency and the plugin for the dependency jar .