How to reference a jar from another project in Eclipse

2

I'm doing a project to test reports from iReport, and was wondering if you can not include the same jars that already exist in a given project. Eclipse itself offers the option to reference the classes of this other project, the problem that it shows the path as for example c:\eclipse\projeto . And this worries me because I'm going to share the project in SVN, and will it be that if another developer downloads it will not cause a jar targeting error?

I would then like to know how to target the jars, and whether this will cause the above mentioned problem.

    
asked by anonymous 10.07.2014 / 16:32

1 answer

1

iReport (at least in versions I know) can not use Eclipse variables.

However, you can adopt a pattern on your team by using environment variables. Each developer must be responsible for creating and properly configuring their environment.

So it should point to this variable, for example, for the project root. This will allow a developer to have multiple workspaces or even different branches of a project.

The problem is that to test a particular project it must ensure that that environment variable actually points to that project. This can cause confusion in some cases.

Other alternatives are:

  • In linux environments, you can set up a symbolic link for the jars folder and use that path in iReport. For example, create on each machine a link in /etc/projeto1 that points to the jars folder. And put the path of that link in iReport.

  • On Windows, you can use the subst command to configure a virtual drive with the jars. For example, use subs P: c:\workspace\projeto1\lib . Then the default is that the reports for this project always point to the P: unit. Other units can be used for different projects.

10.07.2014 / 17:00