From jShell which seems to be easy because I will do java9 a little
Below, raise the dos prompt on windows, move (cd) to the bin folder under JAVA_HOME, and then execute. (It is not necessary to move if you pass the PATH with the environment variable)
C:\Program Files\Java\jdk-9\bin>jshell.exe
|Welcome to JShell--Version 9
|For an overview, type:: /help intro
jshell> String regex = "^Hello";
regex ==> "^Hello"
jshell> Pattern p = Pattern.compile(regex);
p ==> ^Hello
jshell> p.matcher("Hello World").find();
$3 ==> true
jshell> p.matcher("hello World").find();
$4 ==> false
jshell>
If you want to end it, hit / exit.
If you install an IDE such as Eclipse, simple verification can be done immediately, so thank you is subtle, but I'm doing Java for the first time I want to move it a little It's an environment where Eclipse can't be installed There are cases where it is easier to call the Java API than to write a shell that runs on the server with just the shell. I wondered if it would be good at such times. I thought that it was "Oh" that something was output just by defining the variables.
Recommended Posts