Serial.read() gives null value from Arduino and or the port is not open on processing side

Richard, the problem I’m having is that none of the correct values even get over to processing side. I’m not sure if I said but when I use myPort.available(), it is always false and nothing gets printed. I made a new Arduino and new processing script to just try get the serial part working without the rest of the mess and I can’t even get that to work correctly.

New processing code:

import processing.serial.*;

Serial myPort;
String data;
void setup() {
  myPort = new Serial(this, "COM5", 9600);
}

void draw() {
  data = myPort.readString();
  if (myPort.available()>0) {
    println(myPort.readString());
  }
}

Here’s the new Arduino code:

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(random(10));
  delay(500);
}

Processing opens a blank window and outputs nothing into the console.
Arduino Serial monitor (and also a third party serial monitor I got just to check that it’s not being stupid) shows the random numbers from the code. No I do not have the third party serial monitor open when I am trying to get processing to read the serial port.