Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Data Structures Organizing Data Serialization

JJ Brandler
JJ Brandler
988 Points

Issues when working on windows machine and not in launched workspace

when I use the same code on a windows machine, I get this error:

java.io.NotSerializableException: com.teamtreehouse.Treet at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.writeArray(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.writeObject(Unknown Source) at com.teamtreehouse.Treets.save(Treets.java:11) at Example.main(Example.java:27)

Same code seems to work fine in the workspace.

1 Answer

JJ Brandler
JJ Brandler
988 Points

not sure why this fixed it, but after adding the serialVersionUID, it worked.