Generics were introduced in Java 1.5, but it stayed fully backwards compatible. So while
you should use generics whenever possible, if you've got code like this that doesn't use it it'll still run in more modern versions. So I'd suggest using the most current version you can: at least 1.6, if not 1.7.
If you still have a problem with it then, let us know
exactly what the error is and we can probably help you.
Edit: but if you are going to use generics, you need to get the types right. It's no use declaring a
List<String> if you're not intending to put Strings in it! You also need to use generics throughout - creating an
ArrayList<String> but then assigning it to a variable of type
ArrayList doesn't achieve anything.