• Post Reply Bookmark Topic Watch Topic
  • New Topic

Running a java program  RSS feed

 
Bryan Lemmer
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Nalaka Gamage
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!