Go Down

Topic: Serial Communication with Netbeans and Arduino. (Read 1 time) previous topic - next topic


Hi Everyone.

i am trying to get my arduino to communicate to netbeans and im having trouble with getting it to work.
my code is
"package serialtalk;

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{
        System.out.println("Using port: " + Preferences.get("serial.port"));
        CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(

        SerialPort port = (SerialPort)portId.open("serial talk", 4000);
        input = port.getInputStream();
        output = port.getOutputStream();
            while(input.available()>0) {

and the error i get is

java.lang.UnsatisfiedLinkError: C:\Users\mhsec\Desktop\arduino-1.0.4\rxtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\mhsec\Desktop\arduino-1.0.4\rxtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732)
   at java.lang.Runtime.loadLibrary0(Runtime.java:823)
   at java.lang.System.loadLibrary(System.java:1028)
   at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
   at serialtalk.Main.main(Main.java:16)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

I'm extremely lost and i'm not sure what to do.

Lewis Joyce
Lewis Joyce


Hi Lewis

i think the error message is quite obvious:
rxtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

Do you have a 64bit version of rxtxSerial.dll that you can use? Because it looks like you are trying to use a 32bit dll in a 64bit project.
Or is there a setting in Netbeans where you can define your project as a 32bit application. (Rather than 64bit...)


Yeah i saw this message, but i downloaded the RXTX comm and serial in 64bit. And put it in the arduino files and then my arduino program wont load up and i get a launch4j error message.
So im a bit lost in what i can do


Lewis Joyce
Lewis Joyce


I'm not sure why you want to used those libraries anyways.  Getting java to work with serial ports is really easy without it.


ah, im new to all this, so ive been following a tutorial and i dont know how to do it any other way.

Lewis Joyce

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131