DUE and nightly build 1.5.6 beta

i can compile, upload my project,
and when i start terminal it stops after the first output line
and i see error

Exception in thread "EventThread COM12" java.lang.NullPointerException
	at processing.app.Serial.serialEvent(Serial.java:176)
	at jssc.SerialPort$EventThread.run(SerialPort.java:1096)

back to 1.5.5 r2 ?fix? OK

It happens to me, too, with Arduino Uno or Mega, in Windows 7 and 8.1 64 bits, just by opening the Serial Monitor.

As the exception indicates, the problem is in the Serial.serialEvent method, when reading the serial port. So if you look at the code in the GitHub repo:

public synchronized void serialEvent(SerialPortEvent serialEvent) {
    if (serialEvent.isRXCHAR()) {
      try {
        byte[] buf = port.readBytes();
        if (buf.length > 0) {
...

as port.readBytes() may return null.

I've tested this outside Arduino IDE, running a simple Java sample with the JSSC library, 2.8.0, and I had the same problem.

An easy solution could be just checking that buf is not null:

public synchronized void serialEvent(SerialPortEvent serialEvent) {
    if (serialEvent.isRXCHAR()) {
      try {
        byte[] buf = port.readBytes();
        if (buf!=null && buf.length > 0) {
...

Shall I open an Issue on GitHub with this?

Edit: I opened issue #1885, and it's already fixed now! So try the new nightly build, the NPE should not appear anymore.

Jose