diff --git a/app/PdeBase.java b/app/PdeBase.java index 2752deb97..e7b2c27ea 100644 --- a/app/PdeBase.java +++ b/app/PdeBase.java @@ -29,13 +29,18 @@ import java.io.*; import java.net.*; import java.util.*; import java.util.zip.*; -import javax.comm.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.undo.*; +#ifndef RXTX +import javax.comm.*; +#else +import gnu.io.*; +#endif + #ifdef MACOS import com.apple.mrj.*; #endif @@ -824,7 +829,7 @@ public class PdeBase extends Frame } } } catch (UnsatisfiedLinkError e) { - //e.printStackTrace(); + e.printStackTrace(); problem = true; } catch (Exception e) { @@ -833,7 +838,7 @@ public class PdeBase extends Frame } if (serialMenu.getItemCount() == 0) { - //System.out.println("dimming serial menu"); + System.out.println("dimming serial menu"); serialMenu.setEnabled(false); } @@ -842,6 +847,7 @@ public class PdeBase extends Frame // correct lib, but it's at least one that's loaded inside // the javacomm solaris stuff, which is the .jar that's included // with the osx release (and rxtx takes over) + /* if (platform == MACOSX) { try { System.loadLibrary("SolarisSerialParallel"); @@ -850,6 +856,7 @@ public class PdeBase extends Frame problem = true; } } + */ // only warn them if this is the first time if (problem && firstTime) { diff --git a/app/PdePreprocessor.java b/app/PdePreprocessor.java index ab16202b5..ecdaedfe6 100644 --- a/app/PdePreprocessor.java +++ b/app/PdePreprocessor.java @@ -35,7 +35,11 @@ public class PdePreprocessor { static final String application_imports[] = { "java.applet", "java.awt", "java.awt.image", "java.awt.event", "java.io", "java.net", "java.text", "java.util", "java.util.zip", +#ifndef RXTX "javax.comm", +#else + "gnu.io", +#endif // if jdk14 defined, jdk13 will be as well #ifdef JDK13 diff --git a/app/PdeRuntime.java b/app/PdeRuntime.java index 569c619ef..d538b36a1 100644 --- a/app/PdeRuntime.java +++ b/app/PdeRuntime.java @@ -27,6 +27,12 @@ import java.awt.*; // for window import java.awt.event.*; // also for window import java.io.*; +#ifndef RXTX +import javax.comm.*; +#else +import gnu.io.*; +#endif + public class PdeRuntime implements PdeMessageConsumer { @@ -83,7 +89,7 @@ public class PdeRuntime implements PdeMessageConsumer { applet.serialProperties(PdeBase.properties); applet.init(); if (applet.exception != null) { - if (applet.exception instanceof javax.comm.PortInUseException) { + if (applet.exception instanceof PortInUseException) { throw new PdeException("Another program is already " + "using the serial port."); } else {