'Why does scala not see my hello.class as a program in command prompt?

I am trying to run scala program in cmd prompt. And I get the message.

"No, such file or class on class path exists."

Things that may be relevant:

  1. I had several warnings from Windows about downloading and running the scala executable from the site. (I ignored them all )

  2. I had to enter a Admin Command Line to use scala, and it did not show up in my program files after install.

  3. The installer never actually popped up for me. So I ran the executable as administration, now it appears in my program X86 folder. and I can enter scala mode without being in Admin mode. 4. The .scala file does compile. with scalac hello.scala

  4. The code given to me by my instructor, in a file I named hello.scala object hello extends App{ println("Hello") }

Snip of my file folder after scalac command

Finally, I have looked at 2 Youtube videos and 2 Stack posts before asking this question. Thank you all for your time.



Solution 1:[1]

Here's a complete transcript of a successful session compiling and running on this code:

% echo 'object hello extends App{ println("Hello") }' > hello.scala
% scalac hello.scala             
% scala hello       
Hello

Are you doing something different? If so, what is it? Show a transcript of your entire effort, including all commands you entered and all error messages you got.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Seth Tisue