5

I need to add commons-lang3 and commons-math3 so that I can generate medians in my report. I have already downloaded these files, but how do I add them to the classpath so that jaspersoft studio can reference it?

I am using Jaspersoft Studio Professional 5.6.1

I tried going to project explorer and right clicking on the project, but there was no classpath option.

This is not a duplicate of use external JAR file in jaspersoft studio because the solution suggested: right click on project folder > properties > java build path > libraries > add External JARs.. does not appear to be an option to me.

thanks!

Community
  • 1
  • 1
Matt
  • 377
  • 1
  • 4
  • 14
  • @tobi6 ive looked into it, and i think my problem stems off of that question, though in that question, it is stated that they right click and the option is there, however I do not see the option for java build path. I've updated the question with more information. – Matt Aug 24 '16 at 13:47
  • Have you had a look into Edit / Preferences for this setting? – tobi6 Aug 24 '16 at 16:22
  • 1
    ok i found Classpath Variables in preferences, and I have added the .jars.. still, I get the error: org.apache.commons.math3.stat.StatUtils cannot be resolved to a type. Did I add them to the correct spot? – Matt Aug 24 '16 at 16:48

2 Answers2

1

I was struggling with this problem for a while and this is what worked for me:

  1. Place jar in workspace
  2. Right click on project folder > properties > java build path > libraries > add External JARs.
  3. On "Outline" tab click on Project root
  4. Go to Properties tab and import the class/package you want to use:

Properties tab

  1. I needed to use this class in a parameter, so i created the parameter:

enter image description here

  1. Double click on the parameter to open the Expression Editor. Click Paremeter and choose proper type:

enter image description here

  1. Edit Class field in Parameter properties

enter image description here

  1. Project > Clean ... Project > Build
Montaser Sobaih
  • 305
  • 2
  • 7
Kike Lebowski
  • 501
  • 6
  • 6
-1

step 1: on the right side of top appeare an red icon(Design report) step 2: it will be show in left side step 3: will be show the Data Adopter, right click on Data Adopter -> select the new data adopter step 4: select the Database JDBC Connection and press next step 5: write the name of adopter as you want -> select the JDBC driver [mysql(com.mysql.jdbc.Driver)] -> and write the database name in next field after the backslash step 6: select the class path as shown below and click on add button and select jar file. step 7: check connection through test and if succefull than press finish. step 8: enjoy jaspersoft studio professional.