I think the way to do it in project builder would be to create a new project (Java Application) and give it the same name as your main class. Then you can add your source file to the project and you should be able to compile and run it through PB. This is the general idea, i'm not sure if everything is exact, but play around with it. The point being is that i think you can only compile projects, not individual source files that are unrealted to any specific project.
Also, i haven't seen any way to add command line arguments when i run a java app from PB, although i have to admit i haven't looked very hard at all. I hope that helps!
mike