I am a new Java Application developer. I am developing java application by Netbeans. Please help me to run another jar file1 from my main jar file. Where I dont know about the internal classes of java file1.
Asked
Active
Viewed 253 times
0
-
1Link the Jar file into your project (via the Libraries node). The class are now available for you to use – MadProgrammer Mar 10 '15 at 05:51
-
Visit this link: http://stackoverflow.com/questions/4879903/how-to-add-a-jar-in-netbeans – vishal patel Mar 10 '15 at 06:00
-
possible duplicate of [How can I create an executable jar with dependencies using Maven?](http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) – Mhd. Yasseen Mar 10 '15 at 06:12
1 Answers
1
Add jar files into your project. Then import jar file(class) into your code. For instance, jar file name is ExternalJar.jar.. you could import as following
import ExternalJar.yourClassName;

venkat
- 503
- 6
- 15
-
Actually i dont know about internal structure of that java file. – Shohan Ahmed Sijan Mar 10 '15 at 06:54
-
If you don't know anything about the internals of the jar you need to parse its manifest. The string after Main-Class is the main class you should call to run the jar. Of course if the jar is a library it won't contain this attribute. – Iamsomeone Mar 10 '15 at 07:02
-