How can i run my statements from the terminal?
$ java -c System.out.println("test");
bash: syntax error near unexpected token `('
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you are looking for is Groovy, it is a dynamic superset of Java. Which means you can run any Java statement as a Groovy statement. It has an interactive REPL shell that can execute Java statements or Groovy statements equally as well.
You can also write scripts using plain Java statements as well, no need for Groovy syntax short cuts or extensions and run them as scripts.