在OS X - UnsatisfiedLinkError中,JMagick设置了Eclipse的问题:在java.library.path中没有JMagick。

时间:2022-01-18 08:56:34

I am having some trouble setting up my environment in Eclipse for ImageMagick via JMagick in OS X. I have no problems using the ImageMagick command line tools (display, convert, etc.) after installing, but am unable to set up JMagick with a Java project in Eclipse.

我在Eclipse中为ImageMagick在osx中通过JMagick设置我的环境有一些困难,我在安装之后使用ImageMagick命令行工具(显示、转换等)没有问题,但是在Eclipse中无法用Java项目设置JMagick。

Steps taken:

采取的措施:

  1. Downloaded JMagick 6.4.0
  2. 下载JMagick 6.4.0
  3. Generated jar and libs through make process in the INSTALL document
  4. 在安装文档中通过make过程生成jar和libs。
  5. Copied libJMagick.so and libJMagick-6.4.0.so from lib to /usr/lib/java
  6. libJMagick复制。所以,libJMagick-6.4.0。从lib到/usr/lib/java。
  7. Added JMagick.jar to build path
  8. JMagick补充道。jar来构建路径
  9. Linked /usr/lib/java directory to JMagick.jar native source, recommended in the solution posted by trigoman at the following url: JMagick Error when trying to load a file - UnsatisfiedLink
  10. 链接/usr/lib/java目录到JMagick。jar本机源代码,建议在trigoman的解决方案中在以下url: JMagick错误时尝试加载文件-不满意的链接。
  11. Created sample class that accesses JMagick and attempted to run in Eclipse. Exception reported:
  12. 创建了访问JMagick并试图在Eclipse中运行的示例类。异常报告:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no JMagick in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at example.ImageRender.main(ImageRender.java:10)

线程“main”java.lang中的异常。不满足链接错误:java.library中没有JMagick。在java.lang.Runtime.loadLibrary0 . loadlibrary0(运行时.java:823)在java.lang.System.loadLibrary(System.java:1045)中,在example.ImageRender.main(ImageRender.java:10)中。

Does anyone have any ideas what might be the underlying problem is?

有人知道潜在的问题是什么吗?

1 个解决方案

#1


3  

edit: see my comment below about using im4java instead of JMagick.

编辑:请参阅下面关于使用im4java而不是JMagick的评论。

I was having the same problem, but just got it working by following these sparse instructions: http://wesleyli.blog.com/2011/09/01/install-jmagick-on-mac/

我也遇到了同样的问题,但是通过下面这些简短的说明来解决这个问题:http://wesleyli.blog.com/2011/09/09/01/install-jmagick -on-mac/。

But note there's a couple typos; looks like Lion auto-correct problems. So what I did was:

但是注意这里有几个拼写错误;看起来像狮子自动更正的问题。所以我做的是:

svn co https://jmagick.svn.sourceforge.net/svnroot/jmagick jmagick
cd jmagick/trunk
./configure --with-java-home=/System/Library/Frameworks/JavaVM.framework/Versions/Current --with-magick-home=/usr/local/jmagick
sudo make all & sudo make install
sudo ln -s /usr/local/lib/libJMagick-6.5.7.so /Library/Java/Extensions/libJMagick.jnilib

And now it works for me. :)

现在它对我起作用了。:)

#1


3  

edit: see my comment below about using im4java instead of JMagick.

编辑:请参阅下面关于使用im4java而不是JMagick的评论。

I was having the same problem, but just got it working by following these sparse instructions: http://wesleyli.blog.com/2011/09/01/install-jmagick-on-mac/

我也遇到了同样的问题,但是通过下面这些简短的说明来解决这个问题:http://wesleyli.blog.com/2011/09/09/01/install-jmagick -on-mac/。

But note there's a couple typos; looks like Lion auto-correct problems. So what I did was:

但是注意这里有几个拼写错误;看起来像狮子自动更正的问题。所以我做的是:

svn co https://jmagick.svn.sourceforge.net/svnroot/jmagick jmagick
cd jmagick/trunk
./configure --with-java-home=/System/Library/Frameworks/JavaVM.framework/Versions/Current --with-magick-home=/usr/local/jmagick
sudo make all & sudo make install
sudo ln -s /usr/local/lib/libJMagick-6.5.7.so /Library/Java/Extensions/libJMagick.jnilib

And now it works for me. :)

现在它对我起作用了。:)