How to finish a program!

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 2876 Views - Last Post: 13 August 2012 - 11:31 AM Rate Topic: -----

#1 el_pancho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 88
  • Joined: 26-April 12

How to finish a program!

Posted 09 August 2012 - 10:24 AM

hi guys,

i just finished a java console application, i can run it using the java -jar command from my prompt by i want to turn this program into an executable or application, so i can click on it and it starts running, how do i do it?

i am using netbeans IDE.

thank you for your time!

P.S.: This is a new post because i did not explain myself very well before.
Is This A Good Question/Topic? 0
  • +

Replies To: How to finish a program!

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1004
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: How to finish a program!

Posted 09 August 2012 - 10:43 AM

I'm not sure if there's an accepted way of doing this (I'm sure there will be), but I've heard of JSmooth being used before to convert .jar files to .exes.

This post has been edited by RudiVisser: 09 August 2012 - 11:04 AM

Was This Post Helpful? 0
  • +
  • -

#3 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1820
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: How to finish a program!

Posted 09 August 2012 - 10:45 AM

By building ayour application you will have a jar file in your project folder->dist. Then you can distribute the jar file or open it by double click.
Was This Post Helpful? 0
  • +
  • -

#4 el_pancho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 88
  • Joined: 26-April 12

Re: How to finish a program!

Posted 09 August 2012 - 11:27 AM

View PostRudiVisser, on 09 August 2012 - 10:43 AM, said:

I'm not sure if there's an accepted way of doing this (I'm sure there will be), but I've heard of JSmooth being used before to convert .jar files to .exes.


donīt have to be an .exe my problem is, when i build the application and i go to the applicationīs folder, there is a JAR file, but i cannot run the program from there by clicking on it? how do i finish a java program so my user can click on it and start running?
Was This Post Helpful? 0
  • +
  • -

#5 Ghlavac  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 519
  • Joined: 14-January 09

Re: How to finish a program!

Posted 09 August 2012 - 11:40 AM

You need to add a metadata file that points to the right main file, usually the easiest way todo this is via ant builder.
Was This Post Helpful? 0
  • +
  • -

#6 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1820
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: How to finish a program!

Posted 09 August 2012 - 11:54 AM

Oh didnt see that it was console app,the jar file when opened wont open command line so the system.out wont get place to print the output andd so you wont see the effect.
So solution is either to change the manifest or using some open source project like this.

Another option is to send the output to a log or any other file or your own way of displaying...

Or you may set your computer to open jar file with javaw.exe but wont be a good idea unless for testing

This post has been edited by smohd: 09 August 2012 - 11:56 AM

Was This Post Helpful? 0
  • +
  • -

#7 el_pancho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 88
  • Joined: 26-April 12

Re: How to finish a program!

Posted 09 August 2012 - 01:50 PM

If i create the same application, as a console application but using c++, i just build it i double click on the .exe file, why java does not have the same idea? i mean, how do people run they own applications?
Was This Post Helpful? 0
  • +
  • -

#8 Ghlavac  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 519
  • Joined: 14-January 09

Re: How to finish a program!

Posted 09 August 2012 - 02:59 PM

It does, you have to correctly make a runnable jar.
Was This Post Helpful? 0
  • +
  • -

#9 el_pancho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 88
  • Joined: 26-April 12

Re: How to finish a program!

Posted 10 August 2012 - 06:38 AM

View PostGhlavac, on 09 August 2012 - 02:59 PM, said:

It does, you have to correctly make a runnable jar.


That is my point, how do i do that?
Was This Post Helpful? 0
  • +
  • -

#10 Luckless  Icon User is offline

  • </luck>
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,146
  • Joined: 31-August 09

Re: How to finish a program!

Posted 10 August 2012 - 08:06 AM

I know in eclipse you can click the project -> Export -> runnable JAR and it will produce it for you. It can't use input parameters unless you run it from the command line though (not sure if that's important)
Was This Post Helpful? 0
  • +
  • -

#11 el_pancho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 88
  • Joined: 26-April 12

Re: How to finish a program!

Posted 10 August 2012 - 10:17 AM

View PostLuckless, on 10 August 2012 - 08:06 AM, said:

I know in eclipse you can click the project -> Export -> runnable JAR and it will produce it for you. It can't use input parameters unless you run it from the command line though (not sure if that's important)


Yes input parameters are important, i think i ll re-write it in c++, i dont want to run it as a jframe or anything else than command line(prompt) because i donīt have much time left but i ll still watch this post to see if some idea comes up tho
Was This Post Helpful? 0
  • +
  • -

#12 Luckless  Icon User is offline

  • </luck>
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,146
  • Joined: 31-August 09

Re: How to finish a program!

Posted 10 August 2012 - 11:22 AM

http://viralpatel.ne...exe-converting/

I have no idea if his tutorial works but it's worth a shot before rewriting

This post has been edited by Luckless: 10 August 2012 - 11:22 AM

Was This Post Helpful? 0
  • +
  • -

#13 el_pancho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 88
  • Joined: 26-April 12

Re: How to finish a program!

Posted 10 August 2012 - 11:41 AM

View PostLuckless, on 10 August 2012 - 11:22 AM, said:

http://viralpatel.ne...exe-converting/

I have no idea if his tutorial works but it's worth a shot before rewriting


i ll take a look at it, thank you Luckless
Was This Post Helpful? 0
  • +
  • -

#14 sidebrok  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 61
  • Joined: 28-October 10

Re: How to finish a program!

Posted 10 August 2012 - 02:44 PM

im not sure if i do understand your problem, but could you possibly just build a program in c/++ that launches your java app and passes on the arguments? that would be a lot easyer than rewriting it ;) sorry if this sounds really stupid :)
Was This Post Helpful? 1
  • +
  • -

#15 el_pancho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 88
  • Joined: 26-April 12

Re: How to finish a program!

Posted 13 August 2012 - 10:55 AM

View Postsidebrok, on 10 August 2012 - 02:44 PM, said:

im not sure if i do understand your problem, but could you possibly just build a program in c/++ that launches your java app and passes on the arguments? that would be a lot easyer than rewriting it ;) sorry if this sounds really stupid :)


Thank you SideBrok for you attention, it isnīt stupid at all, but i donīt know how do i do it :D
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2