Even though this thread is pretty old, I've faced this issue today. And the root cause for me was the spaces in the path to Ghidra. Moving it to another folder resolved the issue.