How to use *.jar file in native script



I have a third party .jar file(for printing) built in JAVA and I want to include that .jar file in ‘angular 5 + Native Script’ project and use that .jar file classes in Native Script Project. where to and how to place that .jar file in angular5native script


Just place the jar file inside app/App_Resources/android folder and rebuild your project.
The classes of that jar file will be available to your nativescript app.

Another way would be to build a plugin that uses that jar file.


Thanks for the help. I am new to native script. can you just tell me how to rebuild the project


use the cli command for building:
$ tns build android


thank you @jpedraza. I imported the package like this.

const leopardPkg = com.leopard.api;

Now I am getting the error like cannot find the name com . can you tell me how to import the package correctly.


these articles can help you:


with out creating the package can’t we directly import the *.jar file in the angular component