diff --git a/src/main/java/jline/WindowsTerminal.java b/src/main/java/jline/WindowsTerminal.java index d036088..b180caf 100644 --- a/src/main/java/jline/WindowsTerminal.java +++ b/src/main/java/jline/WindowsTerminal.java @@ -273,18 +273,20 @@ private void loadLibrary(final String name) throws IOException { } version = version.replace('.', '_'); - - File f = new File(System.getProperty("java.io.tmpdir"), name + "_" - + version + ".dll"); - boolean exists = f.isFile(); // check if it already exists - + // extract the embedded jline.dll file from the jar and save // it to the current directory int bits = 32; // check for 64-bit systems and use to appropriate DLL if (System.getProperty("os.arch").indexOf("64") != -1) - bits = 64; + bits = 64; + + File f = new File(System.getProperty("java.io.tmpdir"), name + "_" + + version + "_" + bits + ".dll"); + + boolean exists = f.isFile(); // check if it already exists + InputStream in = new BufferedInputStream(WindowsTerminal.class.getResourceAsStream(name + bits + ".dll"));