4 Replies - 363 Views - Last Post: 06 December 2012 - 08:29 PM Rate Topic: -----

#1 ScottyBanKlol  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-December 12

How to run a Java app outside of eclipse

Posted 06 December 2012 - 02:08 PM

I want to create a simple java application using eclipse that I will use at work. I cannot install eclipse to the work computer and was interested in how to go about making an app that can run from a website or another option to where I can run it.

Any help or other suggestions are appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: How to run a Java app outside of eclipse

#2 Luckless  Icon User is offline

  • </luck>
  • member icon

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

Re: How to run a Java app outside of eclipse

Posted 06 December 2012 - 06:24 PM

You have two options

1.) You can write it as a JApplet and embed it in the website

2.) You can export it as an executable JAR file. Eclipse exports it for you. I assume your computer has Java installed so you can run it from the command line using:

java -jar myJar.jar [paramaters]



All you need to do is ensure your environmental varable "PATH" points to the jdk#.#.#/bin folder where the java.exe program resides

EDIT:

While I'm thinking about it. You can write a regular java program, then compile/run it the same way from the command prompt:

javac myClass.java
java myClass



javac.exe is another program inside that bin folder. Eclipse is simply a convenient way to write/compile/run a program all in one go, but you can do it with nothing more than notepad and the jdk

This post has been edited by Luckless: 06 December 2012 - 06:28 PM

Was This Post Helpful? 1
  • +
  • -

#3 ScottyBanKlol  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-December 12

Re: How to run a Java app outside of eclipse

Posted 06 December 2012 - 08:23 PM

Thanks luckless.
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

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

Reputation: 8347
  • View blog
  • Posts: 31,913
  • Joined: 06-March 08

Re: How to run a Java app outside of eclipse

Posted 06 December 2012 - 08:26 PM

You can also simply copy the .class produced to your other computer and
> java MyClass

but Luckless's solution with the .jar is better
Was This Post Helpful? 1
  • +
  • -

#5 ScottyBanKlol  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-December 12

Re: How to run a Java app outside of eclipse

Posted 06 December 2012 - 08:29 PM

Alright thanks. This program is going to be used at work to make life much simpler and im hoping the corporate offices will help with this program down the line.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1