Though it\'s probably reccomended one uses and IDE for coding advanced java projects, I personally prefer running almost entirely command-line (using gedit as a text-editor)
You can get along just fine on the command line by using a packaging tool such as Ant or Maven. Maven is especially handy because it is a higher level tool that already knows how to build various project types: command-line apps, webapps, libraries, etc. It also handles library dependencies by downloading them from repositories.