How to Java code onto Eclipse and make it work?

I am confused as to how copy code for a game, Connect 4, onto Eclipse and make it work.
The problem is I am not sure whether to create a new 'Package' and paste the code there or make a 'Class' and paste it there or whether it's a combination of both.

public String previousPlayer1PieceColour;
public String previousPlayer2PieceColour;
public String previousBoardColour;
public String previousPlayer1PieceType;
public String previousPlayer2PieceType;
public String previousGameType;

For a start, you should post code within "code" tags, so that it keeps the indentation, which in turn helps in reading it.

I'm not an Eclipse user (I use NetBeans for Java), but it looks like you're confused. What do you mean by "make it work"? What are you trying to do? The code you've provided is for one class, but I'm assuming there are others - if this is a part of a standalone application, for example, there needs to be one class with a main() method.

Where did you get this code and what are you trying to do with it? Just build it? Do you need to use Eclipse to do this, or will just using javac/some build system from the command line do?