• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to run a java jar file from Eclipse?

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

I realize this same topic was covered briefly here:

https://coderanch.com/t/419486/vc/Run-jar-file-eclipse

However, I do not have the "Run Configurations" menu option, which is said to be the solution (you can see my "Run" menu options in the screenshot below). I'm running Eclipse 3.3.2.

I'm rather new to java, having worked with it for a couple months, and so that post is not in-depth enough for me to understand. I know the java language itself fairly well, but when it comes to compiling files, and creating/understanding how deployed java applications work, I have almost no knowledge. I also am rather new to Eclipse, having only worked with it for one project for a couple of months, where I had access to source code.

I have now been tasked with making modifications to an in-house java application. However, we do not have the source code, which has somehow been lost ಠ_ಠ. Eventually, I'm going to have to learn how to decompile the class files in the jar, but first things first: I need to figure out how to run the application from Eclipse.

I've organized the files like so in Eclipse (the project is called hbks registrar):



This is how the application appears to end-users when they use it:



The .jar file contains all the compiled classes of the application in it. The .bat file is what users double-click to start the application. The .bat has a single line of code:



So, it goes into the jar file and starts up the HOTTBooksClass class file.

The four other folders I've included in the project are folders referenced by the application. The "lib" folder contains other jars needed by the class files.

So, my question is: How can I run the application from Eclipse? I've tried clicking the .bat and .jar files in the explorer window and running them, but I get errors. Can someone please walk me through what I need to do?

I'm guessing I have to use this "Run Dialog" screen (shown below):



but I have no idea what to do there.

Thanks so much in advance,

-Robert V

NOTE: This is my first time posting on these boards. If I am doing something against normal "posting etiquette", like maybe you guys prefer links to images instead of the actual images, please let me know.

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, your version of Eclipse is really old. Eclipse is now up to version 3.7. Here here is a caveat: some of the menus and selections I refer to might not be in your version.

Second, to run an app, all you need is a class that has a main() method in your project. Then you you can right-click the project and select Run As | Java Application. If, however, you have multiple classes with a main() method, there is some additional configuration.

You might want to go through the tutorials in the help text: Help | Help Contents | Java Development User Guide | Getting Started
 
Robert Van Liew
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright, I'll look into it on Monday, and post updated questions then if necessary.

Thanks!
 
Saloon Keeper
Posts: 28492
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the "Open Run Dialog" is the old name for Run Configurations, but definitely go for a more up-to-date Eclipse.
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic