Hello world programme is not executing - system.out

PS C:\Users\PARKHAR AGARWAL\Desktop> cd "JavaProgramming.java" //written by me in terminal.
cd : Cannot find path 'JavaProgramming.java' because it does not exist. // error
At line:1 char:1
+ cd "JavaProgramming.java"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (JavaProgramming.java:String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
// what should i do now because i have checked that my file is present in desktop.
I m not getting Hello world as a output.

You cannot run JavaProgramming.java with CD.
Files with .java extensions are not compiled programs. You need, first of all, to compile it with some compiler, like javac. It will generate a .jar file.
After that, you can use the java command in the terminal to run this program. Example: java ./JavaProgramming.jar

Related

I get this error when trying flutter upgrade

I get this error when I tried flutter upgrade
& : The term 'C:\Users\USER\anaconda3\Scripts\conda.exe' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At C:\Users\USER\Documents\WindowsPowerShell\profile.ps1:4 char:4
+ (& "C:\Users\USER\anaconda3\Scripts\conda.exe" "shell.powershell" "ho ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\USER\a...ripts\conda.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Currently, I don't have anaconda installed in my system
Anaconda is a distribution of the Python and it has nothing to do with flutter in any way.
Make sure that you write the right command in the terminal.

why isn't vs code working after downloading all necessary extensions?

my text editor (vs code ) is not working , after writing a simple c program , it throws problem like
cc : The term 'gcc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:61
+ ... "c:\Users\HP\HTML .one\.vscode\css\hello.c\" ; if ($?) { gcc hello.c ...
+ ~~~
+ CategoryInfo : ObjectNotFound: (gcc:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
even after downloading all the necessary extension in my text editor (vs code).
The error means that the c compiler, gcc, was not found in your path. Either install it or if you already did update your search path so your IDE can find it.

Why do I have a terminal error in VS Code?

I'm trying to learn Python using VS Code. Onde of my task is to opne a file from folder in VS Code nad then run a terminal but when I'm opening it i have error like below in temrinal
PS C:\Users\Łukasz\Desktop\Exercise Files> & C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/ukasz/Desktop/Exercise Files/Chap02/02_07_begin.py"
& : The term 'C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe' is not recognized as the name of a cmdlet, function, script file, or operable progra
m. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ & C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:/Users/ukasz/...on39/python.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\Łukasz\Desktop\Exercise Files>
Could you explain me what I'm doing wrong? I'm not sure what's wrong in the file path and what I can change. I was just adding a file from my desktop, and also just installing a Python on my computer, nothing more.
If it help - I'm learning from the Linkedin Learnign, so I'm just trying to do what they say ;)

Command in atom terminal giving different results than command prompt

I'm attempting to create a file from my an embedded terminal in my text editor, Atom. The terminal is from the package "platformio-ide-terminal"
When I run a command to create a file in windows command prompt, I am able to create a file without issue, however, when I run the exact same code in my terminal thats embedded in atom it doesn't work.
The command that I'm running is type nul > lecture3.md since I'm trying to create a markdown file. As previously mentioned, this works fine in command prompt, but when I run it in my terminal in atom it seems to interpret the command like I'm trying to enter a folder called "nul", which obviously doesn't exist. The error that's being displayed is as follows:
At line:1 char:1
+ type nul > lecture3.md
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (pathtocurrentfolder\nul:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
I would like to know why this error is happening from my terminal in atom, and not in command prompt, and how I can rectify this issue.
I had a similar exception working on visual code. Most IDE have costume handling exceptions. Probably the IDE is trying to check if nul exist even thou the terminal is passing the command just fine.
I received a similar message on Visual Code for type nul > "yourfile.txt":
> type : Cannot find path 'C:\nul' because it does not exist.
At line:1 char:1
+ type nul > "yourfile.txt"
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\nul:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
Even that I got the error the command worked and the file was created. You could check the folder to confirm the creation of the file from the terminal inside de IDE with the dir command if your working directory is set on the directory where you created the file.

Atom platformio won't run python

I am having trouble getting my atom set up as an IDE. The platformio-ide-terminal package wont run python. I have a simple file called myfile.py which prints a sentence. My working directory is in documents in a fodder I've created for a course I'm using atom for.I get the following error message in my command line in atom:
PS C:\Users\Angus\Documents\UdemyPython_10Apps\Beyond_Basics> python3 myfile.pypython3 : The term 'python3' is not recognized as the name of a cmdlet, function, script file, oroperable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ python3 myfile.py3
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (python3:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Some windows terminals accept py -3 instead of python3 as the proper alias, the command to open and run python programs.