Students are often asked not to use an IDE (I like Visual Studio Java) for their Java projects. Instead they need to use BBEdit without an IDE. BBEdit does not appear to natively support facilitated compile/execute but it does run AppleScrips that can speed things a bit.
The davalign.com site has some scripts written for TextWranger. If you rename them to BBEdit they work well.
Reproducing them here in case that site vanishes. I didn't see much like this. Note if you open and save in macOS Script Editor they will be compiled. I like that the first action is to save the document, it's easy to forget to save before a compile.
Compile java.scpt
tell application "BBEdit"save text document 1set the_file to file of text document 1end tellset AppleScript's text item delimiters to ":"set source_file to the last text item of (the_file as string)tell application "Finder"set the_folder to container of file the_fileend telltell application "Terminal"activateset p to POSIX path of (the_folder as string)set shell_script to "cd " & (quoted form of p) & ¬"; javac " & source_fileif (count windows) is 0 thendo script shell_scriptelsedo script shell_script in the front windowend ifend tell
Run java.scpt
tell application "BBEdit"set the_file to file of text document 1end tellset AppleScript's text item delimiters to ":"set source_file to the last text item of (the_file as string)set compiled_file to text 1 thru -6 of source_filetell application "Finder"set the_folder to container of file the_fileend telltell application "Terminal"activateset p to POSIX path of (the_folder as string)set shell_script to "cd " & (quoted form of p) & ¬"; java " & compiled_fileif (count windows) is 0 thendo script shell_scriptelsedo script shell_script in the front windowend ifend tell
No comments:
Post a Comment