[SOLVED] How to Fix JasperReport Server and iReports in OS X Mavericks

So I am evaluating using JasperServer for an upcoming project. As a result I have a Jasper development environment setup on my MacBook Pro which includes JasperReports Server and Jasper iReports.

Recently I upgraded to OS X Mavericks and everything Jasper came crashing down. After further investigation I discovered a few things:

  1.  Mavericks actually didn’t come with a version of JDK, and in fact removed the version was installed on my Mac.
  2. As a result, $JAVA_HOME appeared to be non-existent
  3. Also, after getting Java installed again the default path bin/java has changed to Commands/java

So, to get things working again I did the following:

Install Java

Go here to download the latest release of java.

 

Upgrade and Reinstall JasperServer

My existing copy of JasperServer would still not run so I upgraded to the latest release (v5.5 at the time of this writing).

Download the latest Jasper here

Note:  In hindsight I’m assuming that this because of the $JAVA_HOME issues and the installer setting paths in configuration files. (Therefore, you may not need to upgrade.  You might be able to simply re-install the existing version. If so, let me know in the comments.)

Once you do this, JasperServer should run again.

Test Java

Check that java is installed

open terminal and type

java -v

You should see your java version number…

To Check your $JAVA_HOME

Open terminal and type:

echo $JAVA_HOME

If you see an empty line then follow steps in Part B, else if you see a path like this:

/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home

then congratulations – continue on to the next step.

Part B) Manually Set Your Java_Home (Only if the last steps didn’t work)

So if you tried to set your JAVA_HOME  on your mac but it didn’t work then try doing the following which was originally written about here:

  1. Start up Terminal
  2. Type “cd ~/” to go to your home folder
  3. Type “touch .bash_profile” to create your new file.
  4. Edit .bash_profile with your favorite editor (or you can just type “open -e .bash_profile” to open it in TextEdit.
  5. Type “. .bash_profile” to reload .bash_profile and update any functions you add.

Now test your JAVA_HOME again – Open terminal and type:

echo $JAVA_HOME

Finally, Tell iReport where Java is in Mavericks

  • Right click on the iReport.app (in Applications)
  • Show Package Contents
  • Navigate to /Contents/Resouces/ireport/etc
  • Edit iReport.conf with your favorite text editor
  • Add a line that says something like
  • jdkhome=“/path/to/javahome”

Where “jdkhome” should match the path that appears when you type “echo $JAVA_HOME” in terminal  For example, mine is:

jdkhome="/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home"

Finally…

Save the file and try running iReport again.  Your problems should be solved.

Let me know on Twitter or in the comments if this helped you!

Related Stuff

Eliot is a software developer by trade and a entrepreneur by spirit. He has built web software for the likes of YMCA, UPS, FedEx, Ford and Harcourt, and helped launch mobile apps like Coupon Policy, TourWrist, and Pocket Legal.

Join him as he learns and shares his experiences of marketing his own products online.

Subscribe via RSS
@EliotDill

Leave a Reply