This code will be added into a method. The import statements does not work in a method. Thats because you need to add them in a separate section or if you want avoid trouble with it use full qualified class names.
Now you probably can imagine nothing of your code is suitable for the tJava component.
If you want get an idea write in the tJava some very simple code lines like
String test = "I am here";
and take a look at the code view of the job. This teaches you everything what you need to write proper Java code for tJava component.