Cannot create an RGBImage instance

Right now our robot doesn’t have a camera on it so we’re trying to run a local program with the wpilibj libraries. We’re loading an image taken from last year onto the program but we can’t get it to do anything. We simplified the code down to just the declaration:

new RGBImage();

Which results in this error:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at edu.wpi.first.wpilibj.image.Image.<init>(
	at edu.wpi.first.wpilibj.image.ColorImage.<init>(
	at edu.wpi.first.wpilibj.image.RGBImage.<init>(
	at localapp.Optical.main(
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.sun.squawk.Address
	at com.sun.squawk.NativeUnsafe.getInt(
	at com.sun.squawk.NativeUnsafe.getUWord(
	at com.sun.squawk.NativeUnsafe.getObject(
	at com.sun.squawk.NativeUnsafe.getAddress(
	at com.sun.squawk.GC.getKlass(
	at com.sun.cldc.jna.Pointer.createStringBuffer(
	at com.sun.cldc.jna.TaskExecutor.<init>(
	at com.sun.cldc.jna.TaskExecutor.<init>(
	at edu.wpi.first.wpilibj.image.NIVision.<clinit>(
	... 4 more
Java Result: 1

What are we doing wrong here?

This seems to be a problem with the squawk VM not being able to work with the hardware. If I understand your post correctly, you’re trying to run this on a computer. The exception says that a string cannot be cast to an address, and it seems that an address has to do with lower level communication to peripherals and some of the primitive data types. The squawk VM is not designed to be run on the computer, so when java tries to allocate some block of memory for your empty image and it uses the address class to access the memory, it fails to do so. Ifyou want to experiment with image pprocessing, you can use vision assistant.