diff --git a/arduino-core/src/processing/app/Platform.java b/arduino-core/src/processing/app/Platform.java index b6ed59cbf..6a03bb4d3 100644 --- a/arduino-core/src/processing/app/Platform.java +++ b/arduino-core/src/processing/app/Platform.java @@ -23,8 +23,6 @@ package processing.app; import cc.arduino.packages.BoardPort; -import com.sun.jna.Library; -import com.sun.jna.Native; import processing.app.debug.TargetBoard; import processing.app.debug.TargetPackage; import processing.app.debug.TargetPlatform; @@ -180,33 +178,6 @@ public class Platform { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - public interface CLibrary extends Library { - CLibrary INSTANCE = (CLibrary)Native.loadLibrary("c", CLibrary.class); - int setenv(String name, String value, int overwrite); - String getenv(String name); - int unsetenv(String name); - int putenv(String string); - } - - - public void setenv(String variable, String value) { - CLibrary clib = CLibrary.INSTANCE; - clib.setenv(variable, value, 1); - } - - - public String getenv(String variable) { - CLibrary clib = CLibrary.INSTANCE; - return clib.getenv(variable); - } - - - public int unsetenv(String variable) { - CLibrary clib = CLibrary.INSTANCE; - return clib.unsetenv(variable); - } - public String getName() { return PConstants.platformNames[PConstants.OTHER]; } diff --git a/arduino-core/src/processing/app/macosx/Platform.java b/arduino-core/src/processing/app/macosx/Platform.java index 72de4a3c0..d2d7c0216 100644 --- a/arduino-core/src/processing/app/macosx/Platform.java +++ b/arduino-core/src/processing/app/macosx/Platform.java @@ -32,7 +32,6 @@ import processing.app.legacy.PApplet; import processing.app.legacy.PConstants; import processing.app.tools.CollectStdOutExecutor; -import javax.swing.*; import java.awt.*; import java.io.*; import java.lang.reflect.Method; diff --git a/arduino-core/src/processing/app/windows/Platform.java b/arduino-core/src/processing/app/windows/Platform.java index 2776fea5c..c5ad48367 100644 --- a/arduino-core/src/processing/app/windows/Platform.java +++ b/arduino-core/src/processing/app/windows/Platform.java @@ -22,8 +22,6 @@ package processing.app.windows; -import com.sun.jna.Library; -import com.sun.jna.Native; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.Executor; import processing.app.PreferencesData; @@ -31,7 +29,6 @@ import processing.app.debug.TargetPackage; import processing.app.legacy.PApplet; import processing.app.legacy.PConstants; import processing.app.tools.CollectStdOutExecutor; -import processing.app.tools.CollectStdOutStdErrExecutor; import processing.app.windows.Registry.REGISTRY_ROOT_KEY; import java.io.ByteArrayOutputStream; @@ -282,36 +279,6 @@ public class Platform extends processing.app.Platform { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - // Code partially thanks to Richard Quirk from: - // http://quirkygba.blogspot.com/2009/11/setting-environment-variables-in-java.html - - static WinLibC clib = (WinLibC) Native.loadLibrary("msvcrt", WinLibC.class); - - public interface WinLibC extends Library { - //WinLibC INSTANCE = (WinLibC) Native.loadLibrary("msvcrt", WinLibC.class); - //libc = Native.loadLibrary("msvcrt", WinLibC.class); - public int _putenv(String name); -} - - - public void setenv(String variable, String value) { - //WinLibC clib = WinLibC.INSTANCE; - clib._putenv(variable + "=" + value); - } - - - public String getenv(String variable) { - return System.getenv(variable); - } - - - public int unsetenv(String variable) { - //WinLibC clib = WinLibC.INSTANCE; - //clib._putenv(variable + "="); - //return 0; - return clib._putenv(variable + "="); - } - @Override public String getName() { return PConstants.platformNames[PConstants.WINDOWS];