# Serial cannot be resolved to a type

**URL:** https://discourse.processing.org/t/serial-cannot-be-resolved-to-a-type/12167
**Category:** Electronics (Arduino, etc.)
**Created:** [June 18, 2019, 6:25pm UTC](https://discourse.processing.org/t/serial-cannot-be-resolved-to-a-type/12167 "2019-06-18T18:25:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![VernH](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@VernH](https://discourse.processing.org/u/VernH)
#### Post date: [June 18, 2019, 6:25pm UTC](https://discourse.processing.org/t/serial-cannot-be-resolved-to-a-type/12167/1 "2019-06-18T18:25:02Z")

</div>

I have a program that uses processing to communicate with and Arduino. I have downlaoaded Processing and installed core 3.5.3 (and all other jars) into eclipse on Windows 8.1. I have import processing.serial.\* but then when I write Serial = port; I get Eclipse error ‘Serial cannot be resolved to a type’. It seems like I’m missing a library or something.

---

<div class="post-metadata">

### Author: ![VernH](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@VernH](https://discourse.processing.org/u/VernH)
#### Post date: [June 18, 2019, 11:53pm UTC](https://discourse.processing.org/t/serial-cannot-be-resolved-to-a-type/12167/2 "2019-06-18T23:53:39Z")

</div>

A typo in my post. I’m not assigning Serial = port I’m declaring port to be of type Serial with this code Serial port;

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [June 19, 2019, 1:06am UTC](https://discourse.processing.org/t/serial-cannot-be-resolved-to-a-type/12167/3 "2019-06-19T01:06:59Z")

</div>

I have not used Eclipse in a while but it sort of came back to me…

I had to add the serial jars from:  
C:\Program Portable\processing-3.4\modes\java\libraries\serial\library

And also add it to build path.

And make sure Serial myport; is in the write place:

> import processing.core._;  
> import processing.serial._;
> 
> // Serial myport; // Did not work here!
> 
> public class MyProcessingSketch extends PApplet  
> {  
> public static void main(String args)  
> {  
> PApplet.main(“MyProcessingSketch”);
> 
> Serial myport;  
> public void settings()  
> {  
> size(800, 600, P3D);  
> }
> 
> public void setup()  
> {   
> }
> 
> public void draw()  
> {  
> }

This compiled without errors.

---

<div class="post-metadata">

### Author: ![VernH](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@VernH](https://discourse.processing.org/u/VernH)
#### Post date: [June 19, 2019, 6:10pm UTC](https://discourse.processing.org/t/serial-cannot-be-resolved-to-a-type/12167/4 "2019-06-19T18:10:40Z")

</div>

Thank you. That resolved my original problem.

Now I have errors in processing.serial/Serial.java. On the line public class Serial implements SerialPortEventListener I get error message SerialPortEventListener cannot be resolved to a type.

Also the declaration public SerialPort port; says SerialPort cannot be resolved to a type
