I made a function that I can open a PDF, but this function is only working on my local machine. When I run the .jar generated on another machine, an error is issued that the PDF file does not exist.
The part that performs this function:
try {
java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
desktop.open(new File("/manual.pdf"));
} catch (IOException ex) {
Logger.getLogger(JFrameInicio.class.getName()).log(Level.SEVERE, null, ex);
System.out.println(ex);
}
The PDF file is in the following location: \ Documents \ NetBeansProjects \ Rectory \ src \ rectory
To create the JAR, I use the package for store method that in my thinking creates a jar with all the necessary files.
I think the PDF is being included in the final jar because without putting the PDF in the src folder, the jar has a final size of 3 MB, my pdf also has 3 MB. When I create the jar with the PDF file in the src folder, the final .jar is 6MB in size (I believe it is the jar + PDF file)