I’m trying to make an EXE file from my Java application using the exe4j tool. I have successfully built the project JAR file as well as the lib
directory. I have created the EXE and its working smoothly. I am creating barcodes & profile photos in my application. This is how I set my path
Saving Image
File outputfile = new File("./src/com/ntap/solution/jmsystem/profilePics/" + formId + ".jpg"); if (outputfile == null) { outputfile.createNewFile(); } boolean write = ImageIO.write(icon, "jpg", outputfile);
loading image...
url = "/com/ntap/solution/jmsystem/profilePics/" + formID.getText() + ".jpg"; ImageIcon icon = new ImageIcon(getClass().getResource(url));
But after converting to the EXE, the image file path doesn't load from where it should load. error appears File Could not found
This process works perfectly with the JAR and also the Project. Are there any concepts I should know before settings paths like this that could be a problem in the exe?
Should I save the images on external location? like C:/documents/..
How do I go about doing this?