Cannot find Java to compile: cannot find file

I am very new to programming, so let me explain where I am:

  • I downloaded the latest JDK
  • I changed the path variable in the environment variables tab, javac starts by itself on the command line
  • I downloaded notepad ++

So, I created a very simple program, pretty much just a hello world deal ...

public class pleaseWork {
public static void main (String[] args) {
    System.out.println("Please work");
      }
}

And saved it to a folder that I have on my C drive, but nowhere in the java folder. I saved it as requestWork.java.

So, I go to the command line, and if I just type javac, it works correctly, but if I type javac, then please Work.java, I get an error -

javac: file not found: pleaseWork.java

, , , ++.java - ?

+4
4

javac: file not found: pleaseWork.java , javac , , pleaseWork.java.

, , JAVA , javac pleaseWork.java.

javac , java .


.
, javac "C:\temp\pleaseWork.java"

JAVA .

+2

... , c . ... ... , "programWorld.java", , java .

0

, javac ( ). cd , pleaseWork.java, javac .

, , java, (pleaseWork.java)

0

To set the JDK temporary path, you need to follow these steps: Try this and let me know if it still does not work, then c:> cd yourNewFolderName, then specify the path

Open a command prompt copy the path to the jdk / bin directory to write at the command prompt: set path = copied_path For example:

set path = C: \ Program Files \ Java \ jdk1.6.0_23 \ bin

0
source

Source: https://habr.com/ru/post/1535860/


All Articles