When compiling java, it prompts that javac cannot find the file.
Cause one: The current compilation path is not the storage path of the java class;
Cause two: There is no definition in the java class or the defined main method is wrong.
Solution:
The first step: switch to the storage path of the java class through the "cd" command;
The second step: Reconfirm the code writing in the java class Is it correct?
Step 3: Enter "javac class name.java", press Enter, and execute. If no error is reported, the compilation is normal. If an error is reported, modify the java class code according to the error
Step 4: Enter "java class name" to run the file.
Recommended tutorial: java introductory tutorial
The above is the detailed content of When compiling java, it prompts that javac cannot find the file.. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Notepad++7.3.1
Easy-to-use and free code editor