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.
- 1You need to include your build environment/IDE or this is a meaningless question.McDowell– McDowell2012-12-24 15:20:42 +00:00Commented Dec 24, 2012 at 15:20
- stackoverflow.com/questions/2591092/…Brian Roach– Brian Roach2012-12-24 15:21:02 +00:00Commented Dec 24, 2012 at 15:21
- @Brain Roach, I tried using commands but it is so irritating and now I need easy steps...Narayan Subedi– Narayan Subedi2012-12-24 15:25:06 +00:00Commented Dec 24, 2012 at 15:25
Add a comment |
2 Answers
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...
1 Comment
Fakipo
Is that jar file stored somewhere?