From the course: Java 8+ Essential Training: Syntax and Structure
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Test simple Java code in JShell - Java Tutorial
From the course: Java 8+ Essential Training: Syntax and Structure
Test simple Java code in JShell
- [Narrator] The JShell command is a mayor new feature of Java 9. When you run JShell you can enter simple Java statements without having to create a whole application or even a Java class. This lets you test simple code before you add it to a larger software package. To run JShell from anywhere in your file system open a Command Prompt or a PowerShell on Windows, or open Terminal on Mac. Make sure you´re added the jdk´s bin directory to your system´s path. On Mac OS this is automatic but on Windows you have to do it yourself. Then, just type jshell. If you have trouble running JShell go back to the previous video on configuring the path and make sure that´s working correctly. When you´re in JShell you can type any Java statement. For example, let´s say I wanted to declare a string value. I´d start with the type of the variable, String. Now, remember, Java is case-sensitive so type it exactly as I´m showing here. Then I´ll give the variable an identifier of s1 and I´ll assign it a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Install Java on Windows2m 17s
-
(Locked)
Add Java to the system PATH on Windows2m 41s
-
(Locked)
Install Java on OS X2m 59s
-
(Locked)
Test simple Java code in JShell4m 49s
-
(Locked)
Install and configure IntelliJ IDEA3m 45s
-
(Locked)
Create a project in IntelliJ IDEA6m 10s
-
(Locked)
Pass arguments to a console application5m
-
(Locked)
Take a tour of IntelliJ IDEA3m 56s
-
(Locked)
Use the Java API documentation4m 24s
-
(Locked)
-
-
-
-