1

On netbeans, everything is fine, when I build project, and execute .jar from the dist folder, also fine. But when I move the .jar and execute; cmd gives me that

enter image description here

it points on the declaration of a JXDatePicker I have the .jar containing JXDatePicker on the library project

enter image description here

Please; help and thanks

Rahal Kanishka
  • 720
  • 13
  • 27
SGA
  • 15
  • 7
  • Is there any other package which you imported your classes from.Its better if you could provide a code – Rahal Kanishka May 28 '16 at 18:19
  • No, I have just one package; and JXDatePicker is used in one class of my project; which code would you to see? – SGA May 28 '16 at 18:47
  • Shouldn't Netbeans be including the Jars as dependencies (placing them in the `lib` directory under the `build` directory and creating a `class-path` manifest entry for them? – MadProgrammer May 28 '16 at 23:34

1 Answers1

0

As I found out, this can happen due to a problem in runtime. Project run fine in compile time but this error occures in runtime.As you said you first build it and run and worked fine.After that you moved your .jar file and run again.This time your jar at a different directory and the JVM still looks for the previous location .If you want you can reset the calsspath like this.
For more reference

set classpath=axis.jar;%classpath%;

Hope this help!

Community
  • 1
  • 1
Rahal Kanishka
  • 720
  • 13
  • 27
  • Can I ask you a question out of topic; I got now a problem in reading a file; called with: `FileInputStream fis = new FileInputStream(".\\src\\sga\\facturation\\alert.ser");` searching told me that this directory becomes wrong because src will not exist ine the jar, how could I do? – SGA May 28 '16 at 21:10
  • Can you put this as a new question and share the link here.Because you can add more resources which will be help full. :) – Rahal Kanishka May 29 '16 at 18:52