Re: [netcdf-java] Include multiarray class in a Java project

Welcome to the bizarre world of Java loggers, where you can successfully compile your code and still get NoClassDefFoundErrors when you run your program.

The problem is that the slf4j logging system (http://www.slf4j.org/), which the netcdf-java library uses, looks for a LoggerFactory at runtime. There are several classes which will satisfy that requirement. You need to include one of them. Your choice of which one is based on how you want messages to be logged.

An easy method is to download
ftp://ftp.unidata.ucar.edu/pub/netcdf-java/slf4j-jdk14.jar and include that jar in your java command line classpath (or in the lib directory in a .war file).

See the note about slf4j at
http://www.unidata.ucar.edu/software/netcdf-java/

Good luck.

Thevenoux Remi wrote:
Hi,

I have to use multidimensional array in a Java program. After a search I found ucar.ma2.Array which look like very nice for my use case.

I'm new in Java and i don't success to add this library (class?...?) in my project. I download from this page : http://www.unidata.ucar.edu/software/netcdf-java/

I try the different way write in the README

_____________________________________________________
RUN THE NETCDF TOOLS UI APPLICATION FROM COMMAND LINE
 1. get the netcdfAll zip file (netcdfAll-2.2.22.zip)

 2. unzip into working directory
3. java -Xmx512m -jar netcdfUI-2.2.22.jar
error when I execute the command :

Exception in thread "main" java.lang.NoClassDefFoundError: 
org.slf4j.LoggerFactory

   at ucar.nc2.util.DiskCache2.<init>(DiskCache2.java:58)
   at ucar.nc2.ui.ToolsUI.main(ToolsUI.java:2820)
_________________________
BUILD AND RUN FROM SOURCE
 1. get the source release (ncSrc-2.2.22.zip)

 2. unzip into working directory
 3. ant compileFromSrc

=> [javac] 5897. ERROR in /home/remi/Bureau/lib 
multi-array/ncSrc-2.2.22/src/main/java/ucar/nc2/util/NetworkUtils.java (at line 37)

/*4. sh runSrcRelease*/


I certainly make mistake, but i don't understand where !




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

_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/

--
Sincerely,

Bob Simons
Satellite Data Product Manager
Environmental Research Division
NOAA Southwest Fisheries Science Center
1352 Lighthouse Ave
Pacific Grove, CA 93950-2079
(831)658-3205
bob.simons@xxxxxxxx

The contents of this message are mine personally and
do not necessarily reflect any position of the
Government or the National Oceanic and Atmospheric
Administration.
<>< <>< <>< <>< <>< <>< <>< <>< <><


  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: