All, trying to set up my environment to begin Java development. Here I have a very simple class:
public class MyClass {
public static void main(String args[]) {
String name = "MyClass";
System.out.println(name.toUpperCase());
}
}
When I build using the default JavaC, I see the following:
/Users/me/.bash_profile: line 9: syntax error near unexpected token `('
/Users/me/.bash_profile: line 9: `-a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'/''
[Finished in 403ms]
The first thing I notice is it builds, but with two error. But the (maybe?) obvious thing to me is bash is throwing an error, but I’m on a zsh Macbook Pro.
When I run with this build
{
"shell_cmd":"javac $file_name && java $file_base_name"
}
I see the same two bash errors as above, but I actually see output in the console (“MYCLASS”)
When I try to run a custom terminus build
{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"working_dir": "$folder",
"shell_cmd":"javac $file_name && java $file_base_name"
}
I see the bash errors again but see this:
/Users/me/.bash_profile: line 9: syntax error near unexpected token `('
/Users/me/.bash_profile: line 9: `-a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'/''
error: file not found: MyClass.java
Usage: javac <options> <source files>
use --help for a list of possible options
[Finished in 0.21s with exit code 2]
And when I try this build to run it in the macOS terminal with runInTerminal.sh
{
"shell_cmd": "runInTerminal.sh 'ls -l \"${packages}\"'",
"env": {
"PATH: "$PATH:/usr/local/bin"
}
}
(edit: removed ** in post markup where I tried to bold the PATH: line for clarity)
I simply see “No Build System” in the bottom status bar.
One thing to note in the final macOS terminal build running runInTerminal.sh, the entire PATH: line is highlighted red in Sublime (I chmod u+x runInTerminal.sh so it’s not permissions).
I think a lot of the wonkery is Sublime is expecting bash, when I’m running zsh.
I’ve been banging my head on this for a few hours and I’m at a loss. Any help is appreciated because I don’t want to run xcode or vs. THANKS!!!