Jump to content
We've recently updated our Privacy Statement, available here ×

How to set classpath for libraries of Jasper Report in Java?

Go to solution Solved by C-Box,

Recommended Posts

Hi, I was just hoping to ask if how to set the libraries (.jar files) of Jasper Reports into my Java swing app. I use the command prompt instead of an IDE so I would manually set the classpath on each enter of the java command. 

ex: java -classpath ".;mysql-connector-java-8.0.15.jar" start (this is my java file).

so how do I set the libraries for Jasper Report, I've heard there's several, that means I'll have to input it in the quotation marks and then seperate them with a semicolon? sorry I've never had to put in more than one library so I do not know. And do I also set the class path when I run the javac command for compiling also? What .jar files would I need to open a pdf file of a Jasper Report using Java swing? Thanks in advance for the help.


Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

What about using wildcards in your cp parameter?


I would put all needed jasper and external library jars into one subfolder "lib" and just use the wildcard syntax to include them.

Which jars really needed depends on what you are doing... if you want to export to excel you would need apache-poi libs as well... if you want to export to pdf you will need itext... so it isn't really defined ... a minimal set of libs are listed here for example: https://stackoverflow.com/questions/25069522/jars-needed-for-jasperreports

hth + regards


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...