简体   繁体   中英

Derby Db NoClassDefFoundError not working outside Netbeans

I wrote a Java application which uses Derby Db embedded driver (I am using Windows 10 and java version "1.8.0_131") Everything works fine inside Netbeans, but I get the following error when I try to run the application from the command line (java -jar ...): java.lang.NoClassDefFoundError: org/apache/derby/shared/common/security/SystemPermission

I understand that there should be some configuration to setup, but I don't know how and where. Can someone help me? Thank you very much Ambrogioderby

I did found the cause of the problem. At compilation time, Netbeans copies all jar files inside the subfolder "dist\\lib". Checking the folder contents, I found that one on the derby jar libraries was not copied into "dist\\lib". The reason is unknown. Even recreating all libraries from the beginning, the missing jar could not be copied. Probably there is some corruption somewhere, but I am not able to detect it. Anyway there is a simple workaround. You can manually copy the jar or tell the installer procedure to do this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM