Jump to content
Changes to the Jaspersoft community edition download ×

Using iReport & Jasper Reports in MAC OS X


2004 IR Help

Recommended Posts

By: bcinteractive - bcinteractive

Using iReport & Jasper Reports in MAC OS X

2004-06-22 04:45

I have been using Jasper Reports and iReport in PC for quite sometime now. However, I have been forced to work on a MAC OS X (panther) right now. I'm hoping that I would not sacrifice my learnings on iReport and JasperReports for now because I see them as very good tools in making reports. I know that both application is OS independent. I'm not familiar in setting up this appz in MAC OS X (panther). Can somebody explain to me how to do this? or point me to some thing that actually knows how to set up this appz in OSX panther. Thanks!

 

 

 

 

By: Gary Nunes - gary_nunes

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-22 20:29

One more thing...

 

I just downloaded iReports 0.3.1. It looks like the Mac OS X right-click problem has been fixed since 0.2.3.1.

 

The main window resizing problem still exists but can probably be fixed as described in an earlier post.

 

Regards,

gary

 

 

 

 

By: Gary Nunes - gary_nunes

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-22 20:34

Yet another thing...

 

When I first tried to run iReports 0.3.1 using the provided iReports.sh script it wouldn't work. After playing around a while I noticed that the script called by iReports.sh (startup.sh in the bin subdirectory) is stored as a DOS file (i.e., with Windows DOS line endings). I converted the startup.sh script to a Unix file (i.e., with Unix line endings) after which everything worked.

 

Regards,

gary

 

 

 

 

By: Giulio Toffoli - gt78

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-24 01:21

Ciao Gary,

 

I have implemented all your suggestions and fixed the startup.sh CR/LF problems.

 

If you have time please check out iReport from CVS repository (0.3.2) and try it to confirm that all works fine.

 

I'll include MacOS X instructions on iReport documentation.

 

Many thanks!

 

Giulio

 

 

 

 

By: Gary Nunes - gary_nunes

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-24 14:38

Giulio,

 

I checked out the latest iReport2 module from CVS and found only one problem: the iReport.sh and startup.sh shell scripts aren't set as executables so I had to "chmod +x" them before I could execute them. After that everything seems to work (at least with respect to the Mac fixes).

 

Thanks for your help,

gary

 

 

 

 

By: Gary Nunes - gary_nunes

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-22 07:21

I've been using Jasper Reports and iReports under Mac OS X for a while (in my case no forcing was necessary <g>...I prefer Macs) so maybe I can help.

 

These comments refer to Jasper Reports 0.5.2 and iReports 0.2.3.1 since I haven't bothered to upgrade recently but, hopefully they will apply to your situation. Here's the "official" disclaimer:

This information applies to my configuration of

- Mac OS X 10.3.3 (and also worked in the most recent version of 10.2.x)

- jasperreports 0.5.2

- iReports 0.2.3.1

 

I haven't had any problems with Jasper Reports. I was able to successfully integrate it into a Java application and, as far as I know, encountered no Mac-specific problems.

 

I've also been able to use iReports and have had only three (relatively) minor issues:

 

1)

iReport wants you to move the "tools.jar" library from the JDK into the location where all the .jars are. On the Mac this library is not called "tools.jar". It is called "dt.jar". For JDK 1.4.2 it's located at:

System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/

 

It's also possible to obtain the alias to the current dt.jar at:

System/Library/Frameworks/JavaVM.framework/Home/lib

 

If you control-click (right click) on the alias dt.jar found above and select "Show Original" it will show the current dt.jar (in my case the one for 1.4.2).

 

2)

In iReports 0.5.2 (I don't know if it was fixed in the latest version) there was a problem with right-clicking (control-clicking) on various iReport objects. I was able to fix the problem by modifying the iReports source and recompiling it. The details can be found in some messages I posted in the iReports "Open Discussion" forum. Here are the URLs (or you can search for messages in that forum by gary_nunes):

RE: Macintosh OSX: right mouse click problem (https://sourceforge.net/forum/message.php?msg_id=2489446)

which discusses the solution and

Macintosh OSX: right mouse click problem (https://sourceforge.net/forum/message.php?msg_id=2462109)

which outlined the problem (and discussed what I thought was the solution at the time of the message).

 

3)

In iReports 0.5.2 under Mac OS X 10.2.8 (I don't know whether this problem was fixed in Panther) you can't resize frames (windows). Again, I was able to fix the problem by modifying the iReports source and recompiling it. The details are in my post

Mac OSX frame resize workaround (https://sourceforge.net/forum/message.php?msg_id=2487656).

 

The source modifications were fairly minor and easy to do (figuring them out was the hard part).

 

I hope some of this helps you,

Gary Nunes

 

 

 

 

By: bcinteractive - bcinteractive

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-27 15:12

Gary,

 

It is good to hear that iReport and Jasper Reports can be used in MAC OS X. However, I'm just a beginner when it comes to 'unix' like programming and manipulating environment setting in MAC OS X. I would gladly appreciate it if you could point out some info on the following:

 

a.) Running my .sh files. I tried 'sh myfile.sh' to execute the .sh file but it does not work. What do I miss here?

 

b.) I've place a .bashrc file ~ directory but it is not executed when I open a new terminal.

 

c.) I've 'export JAVA_HOME=/Library/Java/Home' before running iReport but it reports that java home is not configured right.

 

d.) My version of ant doesnot meet the requirement of iReport. Can I get a newer version for MAC OS X. I have ant 1.3 or something, iReport needed ant 1.5 or 1.6..?.?

 

e.) finally the one you mentioned earliear (tool.jar and dt.jar). What do I do with dt.jar? Rename it to tools.jar and place it in iReports' lib directory?

 

1)

iReport wants you to move the "tools.jar" library from the JDK into the location where all the .jars are. On the Mac this library is not called "tools.jar". It is called "dt.jar". For JDK 1.4.2 it's located at:

System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/

 

It's also possible to obtain the alias to the current dt.jar at:

System/Library/Frameworks/JavaVM.framework/Home/lib

 

If you control-click (right click) on the alias dt.jar found above and select "Show Original" it will show the current dt.jar (in my case the one for 1.4.2).

 

 

Thanks,

 

Benjie

 

 

 

 

By: bcinteractive - bcinteractive

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-27 15:29

PS. Forget e.) Just read it in another thread that its ok to copy dt.jar into iReport lib. By the way, why the different filenames? dt.jar = tools.jar

 

Benjie

 

 

 

 

By: Gary Nunes - gary_nunes

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-27 23:01

Benjie,

 

Immediately below are answers to your questions. Following that is a rather long winded explanation about how to get iReports 0.3.2 running on Mac OS X Panther.

 

 

YOUR QUESTIONS AND ANSWERS:

 

Please excuse me if I'm being overly elementary and just skip whatever you already know. Also, there's a section at the end titled RUNNING IREPORT 0.3.2 ON MAC OS X that's a detailed "how to".

 

 

>

> a.) Running my .sh files. I tried 'sh myfile.sh' to execute the .sh

> file but it does not work. What do I miss here?

>

 

You don't mention which shell you're running. From question (b) I assume bash but, in any case, on versions of Mac OS X before Panther the default shell that Terminal runs is tcsh (a superset of csh and, I assume, sh). If you updated to Panther that will still be the case, however, if you did a clean install of Panther (or received your Mac already running Panther) it's likely that Terminal is running the bash shell instead since that is the Panther shell default.

 

If you're not sure which shell Terminal is running you can look at the title bar...it may show the shell name there (depending on Terminal's "Window Settings..." configuration). If the shell name isn't in the title bar then pull down Terminal's "Terminal" menu and select the "Window Settings..." item. In the panel that appears choose "Shell" from the popup menu at the top of the panel to see the name of the shell Terminal is running.

 

In any case there are a few things to be aware of:

- Unix has a PATH variable similar to Windows. If it doesn't include the current directory (.) then just typing the shell script name won't execute the script (type ./script instead).

- Make sure that shell script files for Unix are actually Unix formatted files. In the past iReport Unix shell files have occasionally been saved as Windows formatted files (i.e., wrong line endings). Fortunately the Unix shell files provided in iReport 0.3.2 have the correct format.

- Make sure that shell script files are executable, i.e., have the execute attribute set. Unfortunately the iReport 0.3.2 I downloaded a couple of days ago from CVS had Unix shell files without the attribute set and had to have the attribute set manually (see details in section RUNNING IREPORT 0.3.2 ON MAC OS X below).

- Make sure that the right shell is trying to run the given script. For example tcsh should be able to run sh scripts but bash won't be able too...unless the script starts with the appropriate "shebang" line (#!/bin/sh in the case an sh script). If you're unfamiliar with the concept of a shell script "shebang" (#!) do a google search on "unix shebang".

 

 

> b.) I've place a .bashrc file ~ directory but it is not executed when

> I open a new terminal.

>

 

Change the name of ".bashrc" to ".profile".

 

 

> c.) I've 'export JAVA_HOME=/Library/Java/Home' before running iReport

> but it reports that java home is not configured right.

>

 

That looks right but perhaps something else went wrong. Here's the contents of my .profile file (executed when Terminal starts up a bash shell):

 

#############################################################################

# my setups for Mac OS X

#

#############################################################################

export PS1='[h:W] u$ '

export PATH=$PATH:/Library/Tcl/bin:.

export JAVA_HOME=/Library/Java/Home

export ANT_HOME=/usr/bin/ant

alias bb=bbedit

 

> d.) My version of ant doesnot meet the requirement of iReport. Can I

> get a newer version for MAC OS X. I have ant 1.3 or something,

> iReport needed ant 1.5 or 1.6..?.?

>

 

Yes you can install the newest version (1.6.1 I think). See section RUNNING IREPORT 0.3.2 ON MAC OS X below.

 

> e.) finally the one you mentioned earliear (tool.jar and dt.jar).

> What do I do with dt.jar? Rename it to tools.jar and place it in

> iReports' lib directory?

>

> ...

>

> PS. Forget e.) Just read it in another thread that its ok to copy

> dt.jar into iReport lib. By the way, why the different filenames?

> dt.jar = tools.jar

>

 

You'd have to ask Apple that (there's no conformance requirement with respect to those library names so, in principal, a Java application shouldn't assume them).

 

 

 

RUNNING IREPORT 0.3.2 ON MAC OS X

 

Again, skip the parts that are too elementary.

 

 

Getting the Latest iReport

--------------------------

First, to get the latest version from the iReports sourceforge CVS repository do the following:

 

1) Start up a "Terminal" window.

2) "cd" to the location where you want the iReport stuff to be downloaded (cvs will create an iReport2 subdirectory at this location during the download).

3) Issue the following cvs commands (cvs is built-in to OS X). Each of these commands is a single command (no line feeds):

 

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ireport login

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ireport co iReport2

 

The first command above (the login command) will prompt for a password. Just press the return key and then issue the second command. CVS will proceed to download files. The result will be a folder called iReport2 created at the current directory that will contain the latest version of iReport (with the Mac fixes). Directory iReport2 contains source code which must be compiled before iReport can be executed.

 

Compiling iReport Source

------------------------

You will need the Java compiler (built-in to Mac OS X) and the latest version of the Ant build tool (which you may have to install).Go to http://ant.apache.org and obtain and install the latest version. It is convenient to setup the shell environment so that the ant command can be executed easily. Here's one way to do it:

 

Install the latest version of ant in a convenient directory. In my case it was:

/Users/gnunes/Documents/Development/Java/classes-libraries-tools/apache-ant-1.6.1

 

Create a symbolic link called "ant" in a directory that's included in the PATH variable. In my case that directory was /usr/bin (which is included in the PATH by default). The symbolic link should point to

/Users/gnunes/Documents/Development/Java/classes-libraries-tools/apache-ant-1.6.1/bin/ant

 

that is, to the ant command in the newly installed ant directory. The command to do that for me was (with current directory set to /usr/bin):

ln -s /Users/gnunes/Documents/Development/Java/classes-libraries-tools/apache-ant-1.6.1/bin/ant ant

 

Also, set the following environment variables (I'm not sure whether they're really needed but set them to be on the safe side):

JAVA_HOME

ANT_HOME

 

My values for these variables are

ANT_HOME=/usr/bin/ant

where I installed ant 1.6.1

 

JAVA_HOME=/Library/Java/Home

the standard value

 

Go (cd) into the iReport2 directory. Under the iReport2 directory you will notice the following:

bin a subdirectory containing shell script startup.sh

build.xml an Ant script that compiles/runs/etc. iReport

iReport.sh a shell script that starts iReport

lib the set of libraries used by iReport

 

Copy dt.jar into the lib directory.

 

To compile iReport (but see **NOTE** below) issue the command

ant jar

 

This compiles the iReport source and creates (under iReport2 directory)

classes a subdirectory containing the compiled iReport classes

target a subdirectory containing the iReport.jar library

 

You should now be able to run iReport using ant. Issue the command

ant iReport

to run iReport.

 

To run iReport using the iReport.sh shell script you need to do a few more things. Giulio forgot to make the .sh script files executable so you need to issue the following commands

chmod +x iReport.sh

chmod +x bin/startup.sh

 

Also, the iReport.jar (created by the ant jar command above) needs to be in the lib subdirectory. Do this by issuing the command

mv target/iReport.jar lib

(or drag it there using the Finder).

 

You should now be able to run iReport either with ant:

ant iReport

or with the shell script:

iReport.sh

 

You will be running the latest version (the as yet unreleased 0.3.2) complete with Mac OS X fixes.

 

**NOTE**:

Recently a new Mac OS X problem was discovered and I provided a fix for it. See forum message "Mac OS X, Cannot Drop Fields, ver 0.3.1,0.3.2" (https://sourceforge.net/forum/forum.php?thread_id=1099648&forum_id=217623) if you want to include this fix in iReport before compiling it.

 

 

I hope some of this helps,

gary

 

 

 

 

 

By: Gary Nunes - gary_nunes

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-28 07:00

P.S.

 

Looking at the ant documentation I think my ANT_HOME is set incorrectly (although it hasn't seemed to matter so far). It is set to

/usr/bin/ant

 

which is a symbolic link that resolves to

/Users/gnunes/Documents/Development/Java/classes-libraries-tools/apache-ant-1.6.1/bin/ant

 

It should actually point to

/Users/gnunes/Documents/Development/Java/classes-libraries-tools/apache-ant-1.6.1

 

-gary

 

 

 

 

By: Gary Nunes - gary_nunes

RE: Using iReport & Jasper Reports in MAC OS X

2004-06-28 11:46

P.P.S

 

So, with regard to ANT_HOME (and environment settings in general) by .profile file (the one that executes when bash shell starts) is now:

 

#############################################################################

# my setups for Mac OS X

#

#############################################################################

export PS1='[h:W] u$ '

export PATH=$PATH:/Library/Tcl/bin:.

export JAVA_HOME=/Library/Java/Home

export ANT_HOME=/Users/gnunes/Documents/Development/Java/classes-libraries-tools/apache-ant-1.6.1

alias ant=$ANT_HOME/bin/ant

alias bb=bbedit

 

 

Hope the previous message didn't cause any problems,

gary

 

 

 

 

By: bcinteractive - bcinteractive

RE: Using iReport & Jasper Reports in MAC OS X

2004-07-08 10:36

Gary,

 

THANKS A LOT, MAN!

You're elementary explainations are elementary but I badly needed those elementary education. It's a great help to me.

 

I'm gonna try out those tips soon. I have manage to make iReport work together with MySQL on OS X. Will update to the new version as soon as I figure out how to complete the report I'm making.

 

Until later!

 

By the way, the terminal is running on bash.

 

Benjie

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...