So i have a jar of a project that i was working on, and i want to use it as a library in another project (resource adapter). I have brought it into the libraries folder, and used an import. I basically want to be able to call that whole project in thar jar from main. Then from main there is one of two functions i want to call. How can i do this?

Thanks

Recommended Answers

All 3 Replies

tried this?
String[] argsToPass = {"main","method"};
MainClass.main(argsToPass);

That code will call the main() method of the MainClass class. If you want to call some methods in a class that is in the jar file, you need to create an instance of the class and use its reference variable to call its methods.

Got it figured out, thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.