+ 12
How can I run java program in powershell window?
I'm trying using javac command but it gives CommandNotFound error.
4 Respostas
+ 3
Make sure that jre in the path.
Navigate to the folder where your file is resting.
Open terminal in that folder and type
javac filename.java
It will creates .class file in that folder
And next again open terminal and type
java filename
That's all
+ 10
Priyanka_D_Ohol try the process below:
Setup environment variables in your system.
set JAVA_HOME to C:\Program Files\jdk1.7
add to PATH variable the string
%JAVA_HOME%\bin
open new cmd session.
navigate your java source folder.
use javac to compile your java files.
https://stackoverflow.com/questions/24464295/compiling-and-running-java-application-using-powershell
I'm not a java user...😃😃😃
+ 2
Please first check your jdk is properly installed or not
+ 1
Adarsh's solution works to me, but not exactly. If typing "java filename", try "java classname". Per example, if the class name is "Gaba gaba", then type "java Gaba gaba", and works, well, works for me, 😁.