• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running a java program

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am new to java and am wondering if there is another way to run your program besides using the command prompt. i normally create a batch file and enter "java MyProgram" from the directory that the main class is in.

is there another way to do this or is there an ide that will create an exe or something along those lines??

Thanks
Bryan
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, yes to all of these things.

1) You can write the batch file so it can be double-clicked.

2) You can put your classes in a "jar" file, with a proper manifest, and configure your desktop to run the file when double-clicked.

3) There are tools that make .exe files out of Java code, but they're frowned on; the "executable jar file" approach in #2 is portable to all OSs, and so is the preferred technique.

Here is one of many documents explaining how to do #2.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use Eclipse http://www.eclipse.org/ or Netbeans http://www.netbeans.org/ IDE. Then you can run the programs from IDE itself.

Regards,
http://javatouch.googlepages.com/eclipse
http://javatouch.googlepages.com/netbeans
 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At initial stages please dont use any IDE's. It will stop your learning curve. Java dosen't have any exe concept since it's not platform dependent. But just google for jar files, you 'll get to know more .
 
Bryan Lemmer
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks guys!!

the jar stuff sounds great. will give it a go when i get some time. thanks for the amazing response time!!

Cheers
Bryan
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic