0

My project contains some JLabels with images. In my project I have mentioned the path for this images. But I need to export this project to another PC. Is there any way to include these images in my project or can I make a jar file that will run fine in other computers with the images that I used?

Jamal Alkelani
  • 606
  • 7
  • 19
  • may be duplicate of [How to zip up a Java eclipse project ...?](http://stackoverflow.com/questions/5385894/how-to-zip-up-a-java-eclipse-project-so-it-can-be-easily-unfolded-onto-another-c) – Thomas Fritsch May 01 '17 at 12:12
  • I only know that the idea with the jar wont work - my guess is that you will have to copy all the images and do some work on the paths used in your code (I think it is better to have all the project resources in a resources folder inside the project anyway - then you could simply export (as archive or as file system or...)) - or make sure that the images exist on your other computer in the exact same path – goerlibe May 01 '17 at 12:13
  • Possible duplicate of [Java: export to an .jar file in eclipse](http://stackoverflow.com/questions/423938/java-export-to-an-jar-file-in-eclipse) – Jamal Alkelani May 01 '17 at 12:46

1 Answers1

0

Replace all hard coded paths and put them in some properties file.Make sure the paths are relative. And then copy entire project and paste onto new PC.

SanketB
  • 1
  • 2