openmicroscopy/openmicroscopy — pull request #2197 by sbesson (2014-03-24 13:38:12+00:00)
Title: OMERO.matlab slf4j dependencies

This PR addressed an issue reported in https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=7469.

With 5.0.0, a dependency on slf4j was introduced in the client. As of MATLAB R2011b and above, `slf4j-api.jar` and `slf4j-log4j12.jar` are shipped under `$matlabroot/java/jarext/jxbrowser/`. For previous versions, these libraries are not present and cause the toolbox to fail when initializing the client.

This PR addresses this issue by:
- including the `slf4j-*` jars under `libs` as part of the build process
- adding a function `getOmeroJars` to return the list of required JARs
- adding the `slf4j-*` JARs to the Java classpath if the version of MATLAB is too old.

To test this PR, the unit tests should now pass under MATLAB R2011a. Additionally, the toolbox should pass basic functionality test (initialize a session, retrieve images, retrieve the raw data):

```
sb286@limo:~$ /opt/matlab-2011a/bin/matlab -nodisplay -nodesktop -r 'runtests test/unit; exit'
Warning: No window system found. Java option 'MWT' ignored

< M A T L A B (R) >
Copyright 1984-2010 The MathWorks, Inc.
Version 7.12.0.635 (R2011a) 64-bit (glnxa64)
March 18, 2011

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

--------------------------
OmeroMatlab Toolbox
5.0.0-DEV-ice35
--------------------------
Test suite: unit
Test suite location: test/unit
24-Mar-2014 09:25:41

Starting test run with 194 test cases.
....................
....................
....................
....................
....................
....................
....................
....................
....................
...........
=============================================================
Last warning is about to be cleared:
------------------------------------
No window system found. Java option 'MWT' ignored
=============================================================

Warning: Objects of omero/client class exist - not clearing java
> In javaclasspath>doclear at 380
In javaclasspath>local_javapath at 196
In javaclasspath at 105
In javarmpath at 48
In unloadOmero at 74
In TestUnloadOmero>TestUnloadOmero.testUnloadedWorkspace at 71
In TestCase>TestCase.run at 74
In TestSuite>TestSuite.run at 85
In TestSuite>TestSuite.run at 85
In runtests at 126

===============================================================
While unloading OMERO, found java objects left in workspace.
Please remove with 'clear ' and then run 'unloadOmero'
again. Printing all objects...
===============================================================

Name Size Bytes Class Attributes

self 1x1 112 TestUnloadOmero

Closing session(s) for 0 found client(s):
--------------------------
OmeroMatlab Toolbox
5.0.0-DEV-ice35
--------------------------
.--------------------------
OmeroMatlab Toolbox
5.0.0-DEV-ice35
--------------------------
.--------------------------
OmeroMatlab Toolbox
5.0.0-DEV-ice35
--------------------------
.
PASSED in 7.598 seconds.
sb286@limo:~$
```