Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)

I updated to macOS Mojave (this happens on Catalina update too, and seems to potentially occur on every major update thereafter) This morning I navigated to my work’s codebase in the Command Line on my MacBook pro, typed in “git status” in the repository and received the error: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), … Read more

How do I copy a folder from remote to local using scp?

How do I copy a folder from remote to local host using scp? I use ssh to log in to my server. Then, I would like to copy the remote folder foo to local /home/user/Desktop. How do I achieve this? 12 scp -r [email protected]:/path/to/foo /home/user/Desktop/ By not including the trailing “https://stackoverflow.com/” at the end of … Read more

Why do JVM arguments start with “-D”?

Why couldn’t the architects of Java let us simply do: java -jar -myProp=”Hello World” myProgram.jar It could work today but suppose that in next Java versions a -myProp argument is introduced as a JVM option.How to distinguish your -myProp from the -myProp JVM option ? No way.So it exists an obvious reason to use -D to define system properties. As other example, instead of -myProp suppose you … Read more

How do I parse command line arguments in Java?

Check these out: Or roll your own: For instance, this is how you use commons-cli to parse 2 string arguments: import org.apache.commons.cli.*; public class Main { public static void main(String[] args) throws Exception { Options options = new Options(); Option input = new Option(“i”, “input”, true, “input file path”); input.setRequired(true); options.addOption(input); Option output = new Option(“o”, “output”, true, … Read more