9 Replies - 4508 Views - Last Post: 08 November 2013 - 04:39 AM Rate Topic: -----

#1 owboateng  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 06-May 11

how to convert .jar to an installable file

Posted 06 May 2011 - 03:19 PM

Hi,
I have written a game in java using Eclipse IDE. I want to know to make make this project into and installable file so that my friends can install it and play it on their PC's...I have searched on the net but im not finding anything i seem to understand.
Please I will appreciate ur help.
Thank u in advance.
Is This A Good Question/Topic? 0
  • +

Replies To: how to convert .jar to an installable file

#2 Renagado  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 117
  • View blog
  • Posts: 388
  • Joined: 14-June 09

Re: how to convert .jar to an installable file

Posted 06 May 2011 - 04:05 PM

Java web start is quite simple. However there isn't a quick n easy thing to do what you want, it's going to take some learning. Can't you just send them the .jar if you want it easy?
Was This Post Helpful? 0
  • +
  • -

#3 n8schatten  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 145
  • View blog
  • Posts: 263
  • Joined: 07-December 10

Re: how to convert .jar to an installable file

Posted 07 May 2011 - 02:50 AM

What exactly do you mean by "installable file"?
If you want to create an executable file (e.g. .exe) have a look at Launch4J. Works pretty well for me :-)

Good luck.
Was This Post Helpful? 1
  • +
  • -

#4 owboateng  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 06-May 11

Re: how to convert .jar to an installable file

Posted 07 May 2011 - 04:08 AM

View Postn8schatten, on 07 May 2011 - 02:50 AM, said:

What exactly do you mean by "installable file"?
If you want to create an executable file (e.g. .exe) have a look at Launch4J. Works pretty well for me :-)

Good luck.


Hello,
Thank for your help i have downloaded and installed the Launch4J you recommended and it works fine.
The problem now is i included some pictures and .wav files in my project and to run it i have to put the generated .exe file in a folder that contains these pictures and .wav files as specified in the project else it wont run. I want to put everything together in the .exe file. It happens also when i generate a runnable .jar file. i have to place it in a folder that contains these music and picture files i used in the project. I hope you understand my question.
Maybe i should do some thing in the Eclipse IDE i use...i dont know.
Thank you in advance for tour help.
Was This Post Helpful? 0
  • +
  • -

#5 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: how to convert .jar to an installable file

Posted 07 May 2011 - 05:18 AM

Wich .exe file do you talk about ?
There is no .exe file in a .jar file (unles you put a Windows executable into it)
Was This Post Helpful? 0
  • +
  • -

#6 owboateng  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 06-May 11

Re: how to convert .jar to an installable file

Posted 07 May 2011 - 05:59 AM

View Postpbl, on 07 May 2011 - 05:18 AM, said:

Wich .exe file do you talk about ?
There is no .exe file in a .jar file (unles you put a Windows executable into it)

I mean I created a .exe file from .jar file but it doesnt run unless i put it in a folder containing the pictures and sound files I used in the project. Im looking for a way so that the sound and picture files will be inside the .jar file so that the .exe file i create will be independent of the sound and picture files. I wish im able to explain better.
Thank you
Was This Post Helpful? 0
  • +
  • -

#7 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2652
  • View blog
  • Posts: 11,191
  • Joined: 20-September 08

Re: how to convert .jar to an installable file

Posted 07 May 2011 - 08:03 AM

You need at least to start off with the resource files inside the jar. Whether Launch4j can deal with it then is another matter. Personally i'd use Web Start. A jvm can be installed if necessary almost automatically with JWS
Was This Post Helpful? 0
  • +
  • -

#8 n8schatten  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 145
  • View blog
  • Posts: 263
  • Joined: 07-December 10

Re: how to convert .jar to an installable file

Posted 09 May 2011 - 12:29 AM

Launch4J can indeed deal with resources inside a jar. However, no matter what tool you use to create the jar, you have to load these from inside the jar rather than from the file system.
I usually create a folder inside my project (source fodler in Eclipse) and inside that folder new packages for the resources. When exporting the project into a jar, you have to include these (should be done by default in Eclipse if you've put the files into a source folder).
E.g. if you have a
|-src //default source folder containing your .java files
|-resources //source folder you created
  |-images //package for images
    |-me.png


Then, if I want to load me.png, I do something like:
ClassLoader.getSystemResource("images/me.png")

This will return a URL pointing to me.png, from which you then can create an Image, or File or something else.
If you do so, Launch4J will work just fine for you and you don't need additional files besides your jar.
Good luck.
Was This Post Helpful? 0
  • +
  • -

#9 Avinashcs018  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-November 13

Re: how to convert .jar to an installable file

Posted 08 November 2013 - 12:02 AM

use Lanu4j to make .exe file
use installshield(Licensed copy) for making installable one
Was This Post Helpful? 0
  • +
  • -

#10 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: how to convert .jar to an installable file

Posted 08 November 2013 - 04:39 AM

View PostAvinashcs018, on 08 November 2013 - 03:02 AM, said:

use Lanu4j to make .exe file
use installshield(Licensed copy) for making installable one

Do you seriously think the OP monitors this thread after more than 2 years ?
Please do not necropost thread mor than 1 or 3 months old
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1