If you don't wan't to use IDEs, then, rather than using just javac, you should look to use command-line tools like Ant or Maven. Note that, these tools are independent of IDEs.
The IDEs include them as a convenience for us.
If you want to use only javac, sure, no problem. You need to set the classpath that includes the necessary libraries (javajee jars in this case) which are needed at compile time. You can then use the jar command to create the war/ear and then manually copy them to the specified folder in the server for deployment.