Как импортировать .dll файлы в java ide используются "eclipse"
Мне нужно знать, как импортировать dll или dll-файлы в мой java-проект
Но я получаю эту ошибку, когда пытаюсь использовать этот метод
СВОЮ ОШИБКУ Я ПОНИМАЮ..... ОНИ ДОЛЖНЫ БЫТЬ БОЛЕЕ ПРОСТЫМ СПОСОБОМ СДЕЛАТЬ ЭТО НАВЕРНЯКА C# ДЕЛАЕТ ЭТО ЛЕГКО, ТАК ЧТО МНЕ НУЖЕН ПРОСТОЙ МЕТОД ДЛЯ JAVA, А ТАКЖЕ ЛЮБОЙ СОВЕТ
Exception in thread "main" java.lang.UnsatisfiedLinkError: no binkw32.dll in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at Game.main(Game.java:148)
import java.io.File; import java.util.Scanner; public class Game { static boolean running = false; private Thread thread; private Game(){ //no other functions should be here initializeGame(); } private void initializeGame() { //Create your game objects and get input } private synchronized void startGame() { if(running){ System.out.println("[DEBUG] Already running"); return; } thread = new Thread(); running = true; thread.start(); run(); } public void run(){ long lastTime = System.nanoTime(); final double ticks = 60.0; double ns = 1000000000 / ticks; double delta = 0; int updates = 0; int frames = 0; long timer = System.currentTimeMillis(); //Game Loop while(running){ long now = System.nanoTime(); delta += (now - lastTime)/ns; lastTime = now; if(delta >= 1){ tick(); delta--; updates++; } render(); frames++; if(System.currentTimeMillis() - timer >= 1000){ timer += 1000; frames = 0; updates = 0; } } stop(); } //Everything that updates private void tick(){ } //Everything that renders private void render(){ try { Scanner x = new Scanner (new File("DATA_1.PAK")); x = new Scanner (new File("DATA_2.PAK")); x = new Scanner (new File("DATA_3.PAK")); x = new Scanner (new File("DATA_4.PAK")); x = new Scanner (new File("DATA_5.PAK")); x = new Scanner (new File("DATA_6.PAK")); x = new Scanner (new File("DATA_7.PAK")); x = new Scanner (new File("DATA_8.PAK")); x = new Scanner (new File("DATA.PAK")); x = new Scanner (new File("DATAA_1.PAK")); x = new Scanner (new File("DATAA_2.PAK")); x = new Scanner (new File("DATAA_3.PAK")); x = new Scanner (new File("DATAA_4.PAK")); x = new Scanner (new File("DATAA_5.PAK")); x = new Scanner (new File("DATAA_6.PAK")); x = new Scanner (new File("DATAA_7.PAK")); x = new Scanner (new File("DATAA_8.PAK")); x = new Scanner (new File("DATAA.PAK")); x = new Scanner (new File("DATAE_1.PAK")); x = new Scanner (new File("DATAE_2.PAK")); x = new Scanner (new File("DATAE_3.PAK")); x = new Scanner (new File("DATAE_4.PAK")); x = new Scanner (new File("DATAE_5.PAK")); x = new Scanner (new File("DATAE_6.PAK")); x = new Scanner (new File("DATAE_7.PAK")); x = new Scanner (new File("DATAE_8.PAK")); x = new Scanner (new File("DATAE.PAK")); x = new Scanner (new File("DATAL_1.PAK")); x = new Scanner (new File("DATAL_2.PAK")); x = new Scanner (new File("DATAL_3.PAK")); x = new Scanner (new File("DATAL_4.PAK")); x = new Scanner (new File("DATAL_5.PAK")); x = new Scanner (new File("DATAL_6.PAK")); x = new Scanner (new File("DATAL_7.PAK")); x = new Scanner (new File("DATAL_8.PAK")); x = new Scanner (new File("DATAL.PAK")); } catch (Exception e) { System.out.println("Could not read file"); } } private synchronized void stop() { if(!running){ return; } running = false; try{ //Pause thread thread.join(); }catch(InterruptedException e){ e.printStackTrace(); } System.exit(1); } public static void main(String []args){ System.loadLibrary("d3d8.dll"); System.loadLibrary("binkw32.dll"); System.loadLibrary("EngineServer.dll"); System.loadLibrary("MEGA.PropertyGrid.dll"); System.loadLibrary("GameDatabase.dll"); System.loadLibrary("StringEditRuntime.dll"); System.loadLibrary("GameClient.dll"); Game game = new Game(); game.startGame(); } }
Что я уже пробовал:
Я уже пробовал этот метод
public static void main(String []args){ System.loadLibrary("d3d8.dll"); System.loadLibrary("binkw32.dll"); System.loadLibrary("EngineServer.dll"); System.loadLibrary("MEGA.PropertyGrid.dll"); System.loadLibrary("GameDatabase.dll"); System.loadLibrary("StringEditRuntime.dll"); System.loadLibrary("GameClient.dll"); }