April 10th, 2009
Introduction (don’t read this)
So you want to write some simple Java programs on your OS X machine. of course you could get Eclipse, but I don’t think that’s a great option if you’ve just started with Java. The auto completion and easy debugging are great if you know what you’re doing, but you won’t learn a lot from those features.
The best way to learn Java is to type everything by yourself, one could use the terminal or textedit for this. I don’t think I’ll have to explain why using an editor like BBEdit will make your typing experience much better, while it won’t do any auto completion, thus giving you the ability to actually learn Java.
One irritating thing of using BBEdit, is that by default it can’t compile and run your java programs by pressing some key on your keyboard: You need to manually compile and run them through a terminal window. Because you don’t want to do this, here’re two applescripts which allow you to compile and run your Java stuff just by pressing one key!
Download the scripts (kinda important)
Official mirror: BBE_Java_scripts.zip (8 KB)
How to use the scripts (make sure you read this)
1. Unzip the scripts in the BBEdit scripts folder (/Users/
2. Open BBE Java Compiler.scpt and change the Java version, if you want to compile with an older version of Java (eg. 1.4) in term_compile.
3. Open BBEdit, and click “Window >> Palettes >> Scripts.
4. Select the BBE Java scripts and assign shortcuts to them with Set Key….
5. You may close the scripts palette