This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

JMagick 6.4.0 + IBM Websphere v6.1 + Ubuntu 10.10  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

First of all, I'm sorry if my english is not so good.

I'm trying to use JMagick in a J2EE web application. My servlet container is IBM Websphere v6.1 and OS is Ubuntu 10.10.

In installed ImageMagick and JMagick from Ubuntu repository: imagemagick version 7:, libjmagick6-java version 6.2.6-0-6build1 and libjmagick6-jni version 6.2.6-0-6build1.

Can anyone tell me how to link jmagick jar and the native library (.so) to my web application or to servlet container?

For Websphere 6.1 running on Windows 7, I found this topic and it worked:

<<As the System Class Loader will delegate to the Extension Class Loader,
a simple alternative to the above is to drop the jmagick.jar file into
the directory [java]/jdk/jre/lib/ext

This should work without the need for any code modifications.

The jmagick.dll has to be in a directory that's in your PATH environment
variable. As the imagemagick directory (for example, C:\Program
Files\ImageMagick-6.2.4-Q16) is added to your PATH when you install
image magick, you can just drop the jmagick.dll into this directory.>>

Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried putting the JAR and the .SO in the same directory where all other JARs are?

Fabio Contigiani
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Now I know (from JMagick sources) that thare are two ways to use jmagick:

1) loading it with system ClassLoader

2) or with application ClassLoader

Native code is loaded by class magick.Magick in jmagick.jar, which must be in the classpath. To switch between theese two ways, I have to call:

System.setProperty("jmagick.systemclassloader", "no");

Here is the static code that loads the dll/so library:

The native system library must be in Java library path. Websphere shows its property java.library.path in log files, when it starts.
To add to library path, I set the system variable LD_LIBRARY_PATH=/usr/lib/jni in Websphere (from server console).

I re-compiled jmagick6.jar in /usr/share/java (because WAS JRE level is 1.5 and jmagick jar was Java 6 level compiled). I put it in my /WEB-INF/lib directory and set "jmagick.systemclassloader" to "no".

Now it seems to work...

Paper jam tastes about as you would expect. Try some on this tiny ad:
global solutions you can do in your home or backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!