I'm completely clueless about applescript and was wondering if the following is possible...
Write a script that saves and compiles a java source file from within BBEdit like the following-
1. saves current document to desktop
2. open terminal window
3. compile current document
4. close terminal window
I ran the script editor, hit record, and opened the terminal app and it didn't record anything. I take it the terminal isn't applescriptable?
Is there an easier approach? Do I need to open terminal to compile my current document with javac? I'm new to both Java and Applescript

I would prefer to stick with BBEdit and not an IDE such as netbeans, so suggestions to use other means will fall on deaf ears.
Thank you!