0

I've recently started using Windows, switching from Ubuntu. I've added the JAVA_HOME and appropriate path variable, from my understanding both commands should give identical results?

PS G:\workSpace> javac .\HelloWorld.java
PS G:\workSpace> java .\HelloWorld
Error: Could not find or load main class .\HelloWorld
PS G:\workSpace> java HelloWorld
Hello, World
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
  • 1
    *from my understanding both commands should give identical results* Why? There is no class called `.\HelloWorld`. – Joe C Jan 28 '18 at 13:23
  • 3
    The argument that you provide the the Java command is a fully-qualifed class name, not a file name. There is no (and there can't be a) class called `.\HelloWorld` – Erwin Bolwidt Jan 28 '18 at 13:24

0 Answers0