Minimal Java environment construction and Hello World

Introduction

For some reason, I wanted to compile and execute the minimum code of Hello World at the command prompt, so this is an article to keep as a memorandum.

code

class hello{
	public static void main(String[] args){
		System.out.println("Hello World");
	}
}

Environmental confirmation

Use Win key </ kbd> + R </ kbd> </ kbd> to display the `[Run]` dialog, and cmd Execute </ kbd>. At the prompt, check if the paths of java.exe and javac.exe``` are in place, and then check the version

> java -version
> javac -version

If you see an error like the one below, check the environment variables because the path is not in your path. Use Win key </ kbd> + Pause </ kbd> </ kbd> to display Control Panel \ System and Security \ System </ kbd> and `[System] Advanced settings] From `.

'javac'Is an internal or external command,
It is not recognized as an operable program or batch file.

Or rather, it's an error because it doesn't pass, so if it should be somewhere, look for it directly under the C drive.

> c:
> cd \
> dir javac.exe /s

This is not a very preferable method, so if you find one, use Ctrl </ kbd> + Esc </ kbd> </ kbd> to forcibly terminate the process. Create a shortcut for ``` javac.exe`` in the found folder, place it in any folder, and execute it.

> javac.lnk {Full path to any java source file}

alt

Frequently used shortcuts (because it's incidental)

--``` [Run] `` `Display the dialog: Win key </ kbd> + R </ kbd> </ kbd> -Show Control Panel \ System and Security \ System </ kbd>: Win key </ kbd> + Pause </ kbd> </ kbd> --Command prompt exe name: cmd </ kbd> --Maximize window at command prompt (portrait): Alt </ kbd> + Space </ kbd> </ kbd>, X </ kbd> </ kbd>, or Win key </ kbd> </ kbd>, ← </ kbd> </ kbd> or ↑ </ kbd> </ kbd> or → </ kbd> </ kbd> --Folder name input completion at command prompt: Tab </ kbd> </ kbd> (Next candidate is displayed each time you press) --Copy a specific range of strings at the command prompt: Alt </ kbd> + Space </ kbd> </ kbd>, E </ kbd> < / kbd>, Enter </ kbd> </ kbd>, Range selection (key operation or drag with mouse), Enter </ kbd> </ kbd> --Paste the clipboard string at the command prompt: Alt </ kbd> + Space </ kbd> </ kbd>, E </ kbd> </ kbd >, P </ kbd> </ kbd>, Enter </ kbd> </ kbd>

Original article

-(Hatena Blog) I wanted to display Hello World on the console anyway in Java

that's all

Recommended Posts

Minimal Java environment construction and Hello World
Hello world in Java and Gradle
[Java] Environment construction
Java environment construction
Java, Hello, world!
Java Hello World
"Hello World" in Java
Java Learning (1)-Hello World
Hello World in Java
java hello world, compile, run
JavaFX environment construction in Java 13
AtCoder Challenge Environment Construction (Java 8)
Java beginners read Hello World
Create a Java and JavaScript team development environment (gradle environment construction)
Hello World for ImageJ Java Plugin
Hello World on AWS Lambda + Java
Hello world with Kotlin and JavaFX
Hello World with Docker and C
Hello World in java in eclipse now
[Java & SpringBoot] Environment Construction for Mac
Hello World with GWT 2.8.2 and Maven
Android OS (7.1.2) build and Hello World
Compare Hello, world! In Spring Boot with Java, Kotlin and Groovy
Minecraft Mod development environment construction (IntelliJ IDEA + Minecraft Forge 1.15.2) + Hello World Mod creation
Java runtime environment construction method (Tomcat @ Linux)
[Processing x Java] Construction of development environment
Java development environment construction memo on Mac
Hello world with Java template engine Thymeleaf
Play Framework 2.6 (Java) environment construction in Eclipse
Java development with Codenvy: Hello World! Run
Spring Boot + Docker Java development environment construction
Hello World on Mac VS Code Java
Hello world with Kotlin and Tornado FX
Environment construction summary with rvm and postgresql
Docker + DynamoDB local + C ++ environment construction and practice
Protobuf and gRPC C ++ environment construction on Ubuntu 18.04
Kaggle environment construction using official Docker and vscode
Road to Java Engineer Part1 Introduction & Environment Construction
JAVA + STS (Spring Tool Suite) environment construction procedure
Read "Hello world"
Java development environment
Until you install Gradle and output "Hello World"
[Java] Hello World with Java 14 x Spring Boot 2.3 x JUnit 5 ~
Java and JavaScript
Hello World with Java Servlet and JSP (Easy web server startup with Maven + Jetty)
XXE and Java
Display "Hello World" in the browser using Java
Display "Hello World" in the browser using Java
Prepare a scraping environment with Docker and Java
A reminder of Docker and development environment construction
Docker environment construction
Wastefully creative "Hello World" output method list (Java)
[LeJOS] Let's program mindstorm-EV3 in Java [Environment construction part 2]
[Java] Environment construction procedure for developing struts 1.3 with Eclipse
Prepare the environment for java11 and javaFx with Ubuntu 18.4
[Environment construction] Build a Java development environment with VS Code!
Hello World comparison between Spark Framework and Spring Boot
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)
[Environment construction] Eclipse installation
[Flutter] Ubuntu 20.04 environment construction
Getters and setters (Java)