I assume you have a Java project created that contains a copy of
this snippet. Now mark the project, select from the context menu
"Properties", select Java Build Path, Tab libraries, Select
external Libraries, browse to you Eclipse installation (if not
already there) and choose depending plug-in jars, You will
need several, e.g.
as well. Now try to start and check for any errors, it may be
that still something is missing. If you don't know where this
entity belongs to, press Ctrl+Shift+T in Eclipse and check for
the type. If you have found it, you can either recognize from
the package name or by simply pressing the link button in
the Package Explorer which Plug-in Dependency it belongs to
and add this as library as well in the same manner as you did
it before.