Command window for java?

Is there a way to run individual java commands without creating a file? As in the matlab command window, where you can just enter one line and it will work.

+8
java matlab
source share
2 answers

Currently None. Java is not a terminal programming language like matlab and python.

To run java applications, commands must be compiled

When compiling, the java compiler turns the code into a class file. The class file contains β€œinstructions” for the computer, which is the application.

To clarify, Java 9 has JShell , which is a REPL for java. You can find early access here .

+5
source share

I think you are looking for something like this

https://blogs.oracle.com/java/jshell-and-repl-in-java-9

Unfortunately, it is not available until java 9, so in its current state it may not be ready for production

try here https://jdk9.java.net/download/

it shows you how to do it

http://www.journaldev.com/9879/java9-install-and-repl-jshell-tutorial

+4
source share

All Articles