How can Netbeans run my application when some of my application's dependencies are not in the “Libraries” folder?
$10-30 CAD
Mbyllur
Postuar over 6 years ago
$10-30 CAD
Paguhet në dorëzim
I have an application what works properly when I run it from Netbeans, but doesn't work properly when I run it from the executable jar produced by the Netbeans "Clean and Build" command. In particular, I'm getting "[login to view URL]" for classes that aren't the "Libraries" folder of my project (for example, [login to view URL], as well as various other classes in [login to view URL]).
I know that ClassNotFoundException is thrown when the given class isn't in the classpath of the application. I had started to manually add all of the various dependencies to the "[Project-Name]\dist\lib" folder created by Netbeans, but I feel like this is not the right way to go about doing this. This doesn't work for all dependencies, with ClassNotFoundExceptions being thrown even if a jar with the relevant class is in "[Project-Name]\dist\lib".
I have no problem getting stuff listed in the "Libraries" folder into "[Project-Name]\dist\lib" folder.
I have noticed that the dependencies that are not listed in the "Libraries" folder are various Java EE components. Since this program is an application client that connects to a Java EE server, and this is my first Java EE project, my guess is that there is something basic about Java EE that I don't understand that has led to this issue.
I have two questions:
1. How can Netbeans run my application when some of my application's dependencies are not in the "Libraries" folder?
2. Is there any way of automatically exporting all of the dependencies not explicitly listed in the "Libraries" folder to "[Project-Name]\dist\lib"?
Also, my project is not a Maven project.