Results 1 to 1 of 1
Thread: Rxtx
- 12-13-2010, 11:40 PM #1
Senior Member
- Join Date
- Sep 2010
- Posts
- 109
- Rep Power
- 0
Rxtx
Ok, i have my java rxtx program, and im having problems, i dont know what is wrong. i installed the RXTX stuff, and im getting errors.
Java Code:package serial; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.InputStream; import java.io.OutputStream; import processing.app.Preferences; public class Main { * *static InputStream input; * *static OutputStream output; * *public static void main(String[] args) throws Exception{ * * * *[COLOR="Red"]Preferences.init();[/COLOR] * * * *System.out.println("Using port: " + Preferences.get("serial.port")); * * * *CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( * * * * * * * *Preferences.get("serial.port")); * * * *SerialPort port = (SerialPort)portId.open("serial talk", 4000); * * * *input = port.getInputStream(); * * * *output = port.getOutputStream(); * * * *port.setSerialPortParams(Preferences.getInteger("serial.debug_rate"), * * * * * * * *SerialPort.DATABITS_8, * * * * * * * *SerialPort.STOPBITS_1, * * * * * * * *SerialPort.PARITY_NONE); * * * *while(true){ * * * * * *while(input.available()>0) { * * * * * * * *System.out.print((char)(input.read())); * * * * * *} * * * *} * *} }
Java Code:[COLOR="red"]Exception in thread "main" java.lang.RuntimeException: Uncompilable source code * * * *at serial.Main.main(Main.java:13) Java Result: 1[/COLOR]
Java Code:Using port: null Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version * = RXTX-2.1-7 [COLOR="red"]Exception in thread "main" gnu.io.NoSuchPortException * * * *at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:218) * * * *at serial.Main.main(Main.java:15) Java Result: 1[/COLOR]
Bookmarks