8 Replies - 2706 Views - Last Post: 12 May 2011 - 02:05 AM Rate Topic: -----

#1 nashbender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 21-April 11

how to run java application without IDE

Posted 09 May 2011 - 09:44 PM

hello how are yall.?
i have a simple question..
i'm currently doing a standalone java project using Eclipse IDE..
how can my users open the application without opening Eclipse and run from there?

sorry im a newbie
:smartass:
Is This A Good Question/Topic? 0
  • +

Replies To: how to run java application without IDE

#2 sakshamkum  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 19
  • View blog
  • Posts: 232
  • Joined: 09-June 09

Re: how to run java application without IDE

Posted 09 May 2011 - 09:54 PM

in your command line first compile by javac then execute by interpreter java

in windows use javac.exe and java.exe

for a standalone application you can deploy it in a jar file and its properties allow you to execute from the class which has a main() method and which you set as Main-Class
else you can use a batch file that has instructions to run your program from the command line shell just as you do without an IDE

This post has been edited by sakshamkum: 09 May 2011 - 10:01 PM

Was This Post Helpful? 1
  • +
  • -

#3 nashbender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 21-April 11

Re: how to run java application without IDE

Posted 10 May 2011 - 12:14 AM

View Postsakshamkum, on 09 May 2011 - 09:54 PM, said:

in your command line first compile by javac then execute by interpreter java

in windows use javac.exe and java.exe

for a standalone application you can deploy it in a jar file and its properties allow you to execute from the class which has a main() method and which you set as Main-Class
else you can use a batch file that has instructions to run your program from the command line shell just as you do without an IDE


thanks for helping me! i followed your suggestions and now i created a jar files from the classes..and i can execute using my terminal.. :bananaman:
Was This Post Helpful? 0
  • +
  • -

#4 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 run java application without IDE

Posted 10 May 2011 - 03:26 AM

Not really need to jar anything
On the console window cd to where your .class files are and then
> java MyClass
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7565
  • View blog
  • Posts: 12,697
  • Joined: 19-March 11

Re: how to run java application without IDE

Posted 10 May 2011 - 08:18 AM

"Not really need to jar anything"

True. But if you have multiple classes, and especially if there are required non-standard libraries, it's much easier to make the jar your deployable unit so you don't have to screw around with classpaths and whatnot.
Was This Post Helpful? 0
  • +
  • -

#6 nashbender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 21-April 11

Re: how to run java application without IDE

Posted 11 May 2011 - 06:50 PM

yup i got a lot of classes in the application..furthermore, if i want to give this to client, wouldnt it be hard for them to always run it from cmd or terminal?
Was This Post Helpful? 0
  • +
  • -

#7 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7565
  • View blog
  • Posts: 12,697
  • Joined: 19-March 11

Re: how to run java application without IDE

Posted 11 May 2011 - 10:11 PM

Are you building this in an IDE, or from the command line?

Most IDEs will have an annoying pointy-clicky way of making an executable jar. Of course, annoying pointy-clicky is apparently a feature in IDEs, so maybe you'll like it. In Eclipse, it's under "Export", in the file menu, if I remember correctly. It'll walk you though a set of clicks, and then you'll have an executable jar.

Or, if you're coding for real, you'll have set up a build file which will have a "jarfile" target - executing that will whip up a jar for you, and you don't even have to exit vi to do it.

Not that I'm biased about development environments or anything...
Was This Post Helpful? 0
  • +
  • -

#8 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 run java application without IDE

Posted 12 May 2011 - 12:23 AM

Put hat one in your Favorites

http://download.orac...asicsindex.html
Was This Post Helpful? 0
  • +
  • -

#9 g00se  Icon User is online

  • D.I.C Lover
  • member icon

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

Re: how to run java application without IDE

Posted 12 May 2011 - 02:05 AM

Just choose Export in Eclipse and it will jar the application. Run as


java -jar exported-jar.jar

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1