@@ -57,16 +57,11 @@ end tell
57
57
try
58
58
tell application " Terminal"
59
59
activate
60
- if (package_name is "" ) then
61
- # Define a simple javac command for single class programs without package declaration
62
- set shell_script to " cd " & quoted form of folder_path & ¬
63
- " ; javac " & compiled_name & " .java"
64
- else
65
- # Define a more complex command for package structures:
66
- # Find all *.java files in the directory and compile them
67
- set shell_script to " cd " & quoted form of folder_path & ¬
68
- " ; find . -name \" *.java\" -print | xargs javac "
69
- end if
60
+
61
+ # Define compilation targets by finding all java-files
62
+ set shell_script to " cd " & quoted form of folder_path & ¬
63
+ " ; find . -name \" *.java\" -print | xargs javac "
64
+
70
65
# Execute the command in the terminal for the user
71
66
if (count windows) is 0 then
72
67
do script shell_script
@@ -86,8 +81,13 @@ if (no_error) then
86
81
activate
87
82
88
83
89
- set shell_script to " cd " & quoted form of folder_path & ¬
90
- " ; java " & package_name & " ." & compiled_name
84
+ if (package_name is "" ) then
85
+ set shell_script to " cd " & quoted form of folder_path & ¬
86
+ " ; java " & compiled_name
87
+ else
88
+ set shell_script to " cd " & quoted form of folder_path & ¬
89
+ " ; java " & package_name & " ." & compiled_name
90
+ end if
91
91
92
92
93
93
if (count windows) is 0 then
0 commit comments