Jawin package! hope u work!

I am trying to make something new in my project ...
I found some resources called: ICTCLAS(Institute of Computing Technology, Chinese Lexical Analysis System)
so I am going to integrated into our KM system, adding DOCUMENT RELEVANCY feature.
In fact, ICTCLAS provides a API as DLL, so I need to use JAVA JNI to use the DLL...
then I found Jawin on Google~~~
---------------------------------------------------
OK, very simple sample code:

/*
 * HelloDll.java -
 *
 * This file is part of the Jawin Project:
http://jawinproject.sourceforge.net/
 *
 * Please consult the LICENSE file in the project root directory,
 * or at the project site before using this software.
 */
/* $Id: HelloDll.java,v 1.2 2004/01/04 12:00:27 arosii_moa Exp $ */
package demos;
import org.jawin.FuncPtr;
import org.jawin.ReturnFlags;
/**
 * Demo that uses the Win32 MessageBoxW API-method.
 *
 * @version     $Revision: 1.2 $
 * @author      Stuart Halloway,
http://www.relevancellc.com/halloway/weblog/
 */
public class HelloDll {
 public static void main(String[] args) {
  try {
   FuncPtr msgBox = new FuncPtr("USER32.DLL", "MessageBoxW");
   msgBox.invoke(0, "Hello From a DLL", "From Jawin", 0, ReturnFlags.FAIL_ON_FALSE);
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}
------------------------------------------------
for the first time , it's not work and the the console said:

java.lang.UnsatisfiedLinkError: no jawin in java.library.path
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)
 at java.lang.Runtime.loadLibrary0(Runtime.java:788)
 at java.lang.System.loadLibrary(System.java:834)
 at org.jawin.Bootstrap.<clinit>(Bootstrap.java:33)
 at org.jawin.FuncPtr.<init>(FuncPtr.java:28)
 at dominojava.DominoJava.main(DominoJava.java:35)
Exception in thread "main"


so I checked its doc. Yes, I need to set the standard java.library.path property first.
wait, more simple way, just put jawin.dll file into System32 directory is ok.... because System32 is the default location of java.library.path.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值