-1

Suppose I have a java class file which can be used in many projects. So, I want to create a jar file and it can be used in any other projects as needed. How to achieve this ? I am using eclipse IDE.

3
  • 1
    You need to include your build environment/IDE or this is a meaningless question. Commented Dec 24, 2012 at 15:20
  • stackoverflow.com/questions/2591092/… Commented Dec 24, 2012 at 15:21
  • @Brain Roach, I tried using commands but it is so irritating and now I need easy steps... Commented Dec 24, 2012 at 15:25

2 Answers 2

4

I found the solution as below:

First create your java file as you require. Right click your project -> click on export -> select option jar, follow the dialog box. Now, you have created your own java jar file.

Create your new project as you require, import that jar file as you are importing other jar files. Now, you can import that created jar file's methods or anything as you required...

Sign up to request clarification or add additional context in comments.

1 Comment

Is that jar file stored somewhere?
2

You can find all necessary steps to create a JAR in Eclipse here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.