Issue
I'm trying to run my school assignment on VS code, but I'm getting this error. I've already been running my code from home and it always worked just fine but this file just doesn't want to run.
This is what I get from the terminal
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\orave\Google Drive\APCSA\PROG 2\Introduction & Analysis of Algorithms\Sorting Stats\selection&insertionSort> & 'c:\Users\orave\.vscode\extensions\vscjava.vscode-java-debug-0.31.0\scripts\launcher.bat' 'C:\Program Files\AdoptOpenJDK\jdk-11.0.9.101-hotspot\bin\java.exe' '-Dfile.encoding=UTF-8' '-cp' 'C:\Users\orave\AppData\Roaming\Code\User\workspaceStorage\3e4f84fdbcb8ec16980a673d4ef46a02\redhat.java\jdt_ws\selection&insertionSort_48006976\bin' 'sortingAlgorithms'
Usage: java [options] <mainclass> [args...]
(to execute a class)
or java [options] -jar <jarfile> [args...]
(to execute a jar file)
or java [options] -m <module>[/<mainclass>] [args...]
java [options] --module <module>[/<mainclass>] [args...]
(to execute the main class in a module)
or java [options] <sourcefile> [args]
(to execute a single source-file program)
Arguments following the main class, source file, -jar <jarfile>,
-m or --module <module>/<mainclass> are passed as the arguments to
main class.
where options include: // just some arguments
The system cannot find the path specified.
Solution
I opened VS code into my school folder, not my project folder, the compiler wants to be run in the same folder as the main file.
Answered By - Patrick Orave