亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 系統 > Windows > 正文

Windows環境下Java加載DLL

2020-05-27 13:11:41
字體:
來源:轉載
供稿:網友

   How to Load a Java Native/Dynamic Library (DLL)

  There are several ways to make it possible for the Java runtime to find and load a dynamic library (DLL) at runtime. I will list them briefly here, followed by examples and further explanation below.

  Call System.load to load the DLL from an explicitly specified absolute path.

  Copy the DLL to one of the paths already listed in java.library.path

  Modify the PATH environment variable to include the directory where the DLL is located.

  Specify the java.library.path on the command line by using the -D option.

  If using Eclipse, set the java.library.path in Eclipse for development/debugging.

  1. Call System.load to load the DLL from an explicitly specified absolute path.

  This choice removes all uncertainty, but embeds a hard-coded path within your Java application. Example:

  import com.chilkatsoft.CkZip;public class Test { static { try { System.load("C:/chilkatJava/chilkat.dll"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load./n" + e); System.exit(1); } } public static void main(String argv[]) { CkZip zip = new CkZip(); System.out.println(zip.version()); }}

  2. Copy the DLL to one of the paths already listed in java.library.path

  To see the current value of the PATH environment variable, open a MS-DOS prompt and type:

  echo %PATH%

  Another way of viewing the java.library.path is to run this Java code:

  String property = System.getProperty("java.library.path");StringTokenizer parser = new StringTokenizer(property, ";");while (parser.hasMoreTokens()) { System.err.println(parser.nextToken()); }

  Note: The java.library.path is initialized from the PATH environment variable. The directories may be listed in a different order, and the current directory "." should be present in java.library.path, but may not be listed in the PATH environment variable.

  The loadLibrary method may be used when the directory containing the DLL is in java.library.path. To load "chilkat.dll", call System.loadLibrary("chilkat"), as shown here:

  import com.chilkatsoft.CkZip;public class Test { static { try { System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load./n" + e); System.exit(1); } } public static void main(String argv[]) { CkZip zip = new CkZip(); System.out.println(zip.version()); } }

  3. Modify the PATH environment variable to include the directory where the DLL is located.

  Do this by modifying the PATH environment variable from the Windows Control Panel.

  Set PATH on Windows XP:

  Start -> Control Panel -> System -> Advanced

  Click on Environment Variables, under System Variables, find PATH, and click on it.

  In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.

  Close the window.

  Reopen Command prompt window, and run your java code.

  Set Path on Windows Vista:

  Right click “My Computer” icon

  Choose “Properties” from context menu

  Click “Advanced” tab (“Advanced system settings” link in Vista)

  In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.

  Reopen Command prompt window, and run your java code.

  Important: Setting the PATH environment variable from a MS-DOS command prompt has no effect on java.library.path. For example, this does not work:

  set PATH=c:/chilkatJava;%PATH%java Test

  Also, modifying the java.library.path from within Java code does not work either:

  static { try { // Adding a directory to java.library.path here will not change anything. // System.loadLibrary will still look in the directories listed in java.library.path // as it existed at the very start of the program. // The extra directory path added to java.library.path will not // be searched by loadLibrary. String libpath = System.getProperty("java.library.path"); libpath = libpath + ";C:/chilkatJava"; System.setProperty("java.library.path",libpath); System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load./n" + e); System.exit(1); } }

  4. Specify the java.library.path on the command line by using the -D option.

  For example:

  java -Djava.library.path=c:/chilkatJava TestApp

  5. If using Eclipse, set the java.library.path in Eclipse for development/debugging.

  Open Project->Properties, select “Java Build Path”, click on the “Add External JARs…” button and add the “chilkat.jar”

  (still within the Project Properties dialog) Click on the “Run/Debug Settings”, select your Java class, then click on the “Edit…” button. Select the “Arguments” tab, then add -Djava.library.path=”C:/chilkatJava;${env_var:PATH}” where “C:/chilkatJava” is the directory path containing the “chilkat.dll” file.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
成人网在线视频| 最近2019中文字幕在线高清| 久久伊人91精品综合网站| 国产精品美女999| 中文字幕在线精品| 中文字幕亚洲天堂| 日韩电影在线观看中文字幕| 亚洲xxxxx| 成人中文字幕+乱码+中文字幕| 91国产精品91| 国产亚洲美女久久| 在线精品高清中文字幕| 亚洲福利在线观看| 国色天香2019中文字幕在线观看| 国产成人免费91av在线| 欧美一级淫片videoshd| 91亚洲国产成人精品性色| 97精品伊人久久久大香线蕉| 国产精品久久久久久久久粉嫩av| 九九精品在线视频| 国产精品久久久久av| 一本一本久久a久久精品牛牛影视| 高清一区二区三区四区五区| 欧美激情网友自拍| 热re91久久精品国99热蜜臀| 91老司机精品视频| www.日韩视频| 欧美专区中文字幕| 欧美大全免费观看电视剧大泉洋| 91爱视频在线| 色偷偷噜噜噜亚洲男人的天堂| 亚洲午夜激情免费视频| 欧美乱大交xxxxx| 亚洲视频一区二区三区| 欧美激情一级精品国产| 视频直播国产精品| 欧美成人激情图片网| 色综合天天狠天天透天天伊人| 国产成人福利视频| 日韩在线观看免费av| 日韩电影免费观看中文字幕| 精品久久久久久久久久久久久久| 91久久久国产精品| 亚洲欧美精品中文字幕在线| 亚洲激情小视频| 福利一区视频在线观看| 亚洲色图美腿丝袜| 中国日韩欧美久久久久久久久| 亚洲综合成人婷婷小说| 日韩经典第一页| 久久精品一本久久99精品| 狠狠色香婷婷久久亚洲精品| 日韩av网站电影| 亚洲视频在线观看视频| 国产精品偷伦视频免费观看国产| 国产精品91久久久久久| 国产精品一区二区三区在线播放| 亚洲国产欧美在线成人app| 久久久久久久影院| 亚洲国产成人精品久久久国产成人一区| 97超级碰碰人国产在线观看| 国产成人精品国内自产拍免费看| 日韩精品中文在线观看| 成人亚洲欧美一区二区三区| 精品国产鲁一鲁一区二区张丽| 久久91亚洲人成电影网站| 亚洲最大av在线| 懂色av一区二区三区| 国产视频久久久久久久| 精品久久久久久久久久国产| 日本人成精品视频在线| 91久热免费在线视频| 97视频在线观看播放| 久久久精品999| 日本久久久久久久久久久| 国产69久久精品成人看| 日韩亚洲欧美中文高清在线| 奇米影视亚洲狠狠色| 色www亚洲国产张柏芝| 国产亚洲美女久久| 欧美最近摘花xxxx摘花| 国产亚洲精品久久久| 国产亚洲一区二区精品| 91久久精品美女| 亚洲国产高清高潮精品美女| 日本久久久久久久久久久| 亚洲国内精品视频| 这里精品视频免费| 最好看的2019的中文字幕视频| 久久精品国产一区二区电影| 亚洲va欧美va在线观看| 久久精品国产亚洲7777| 成人精品视频久久久久| 国内久久久精品| 黄色成人av网| 欧美日韩高清在线观看| 九九精品视频在线观看| 欧美极品欧美精品欧美视频| 国产精品一区二区三区免费视频| 91精品在线影院| 国产欧美在线播放| 欧美日韩在线视频观看| 欧美大肥婆大肥bbbbb| 国产精品国语对白| 亚洲欧美日韩第一区| 91国偷自产一区二区三区的观看方式| 久久人人爽人人爽人人片亚洲| 欧美成人精品在线播放| 91精品久久久久久久久久另类| 尤物九九久久国产精品的特点| 亚洲在线观看视频网站| 中文字幕在线成人| 色多多国产成人永久免费网站| 国产精品白嫩美女在线观看| 国产精品亚洲激情| 最近2019好看的中文字幕免费| 国产亚洲精品一区二区| 国产不卡av在线| 国产精品亚发布| 亚洲aa在线观看| 亚洲精品欧美日韩专区| 隔壁老王国产在线精品| 久久久久久高潮国产精品视| 人体精品一二三区| 中文字幕亚洲情99在线| 国产精品ⅴa在线观看h| 国产热re99久久6国产精品| 亚洲成人久久电影| 日韩精品极品毛片系列视频| 欧美高清视频在线| y97精品国产97久久久久久| 国产精品高潮呻吟久久av无限| 国产精品高潮呻吟视频| 亚洲国产精品中文| 欧美最猛性xxxxx免费| 国产精品日韩电影| 91久久久久久久久| 国产视频丨精品|在线观看| 国产精品一区二区三区在线播放| 欧美在线免费视频| 久久久久久久色| 精品美女久久久久久免费| 欧美性xxxxx| 国产精品99久久久久久www| 国产亚洲精品久久久久久牛牛| 日本欧美国产在线| 国产精品电影网| 一区二区三区 在线观看视| 日韩在线中文字幕| 亚洲欧美中文字幕在线一区| 国产成人精品视频| 国产精品视频自在线| 亚洲福利视频专区| 日韩一二三在线视频播| 国产精品一区二区三区成人| 亚洲精品免费一区二区三区| 91av在线免费观看视频| 92版电视剧仙鹤神针在线观看| 亚洲高清福利视频| 国产在线观看91精品一区| 亚洲欧洲免费视频| 国产精品久久久久久影视| 国产精品网红福利| 欧美性极品xxxx娇小|