Distributing Java Application and files -


i have written java application talk blood machine. , posts data web server using oauth security , xml, , application works great.

but need distribute customers have these machines. program in .jar file , requires other .jar files in project/dist folder.

during execution uses little .png files displayed icons on screen, user can click etc.

i want how wrap of (including images) , distribute them either installer or can use web server.

what best way accomplish this, tried copy .jar , dist folder (as per instructions came out of netbeans) when run java -jar myfile.jar prints out text had ioexception because have not included .png files.

code png files: im using this:

try      {         databaseimage = imageio.read(new file("image/database.png"));         databasedisconnectedimage = imageio.read(new  file("image/database_delete.png"));      }      catch (ioexception ioe)     {         system.out.println("problem creating systray: "+ioe.getmessage()+" current working directory is: "+system.getproperty("user.dir"));     } 

you have number of alternatives including following:

  • build installer installs relevant files on user's machine. can either write scratch or use commercial or open-source tool create installer. (installing on multiple operating system types gets complicated ...)

  • restructure application resources (e.g. images) fetched via classpath rather directly file system. create executable "uber-jar", exploding of dependent jars , resources, assembling files 1 tree, , jar-ing tree. (the jar made executable adding couple of entries manifest.)

  • create jnlp launcher application. works if end-user going able access website hosts application files, neatly solves problems of updating application, , ensuring user using up-to-date jvm.

which best? each alternative has pros , cons, , need work out best for you.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -