#VS code
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
It is possible that the previous behavior was due to a configuration change or an update in your development environment. By default, when you run a Java file in VS Code, it will compile the code and create a corresponding .class file.
To run a Java file without seeing the .java file, you can use the Java Debug Extension for VS Code. This extension allows you to directly run your Java code without explicitly compiling it first.
Here's how you can use the Java Debug Extension:
- Install the Java Extension Pack for VS Code.
- Open your
.javafile in VS Code. - Press
Ctrl + Shift + P(orCmd + Shift + Pon macOS) to open the command palette. - Type "Java: Run Java File" and select it from the list of options.
This will execute your Java code without showing the .java file.
Alternatively, if you prefer running your code from the terminal, you can navigate to the directory containing your .java file using the terminal and use the javac and java commands to compile and run your code respectively.
Please note that it is generally recommended to separate source files (.java) from compiled files (.class) for better organization and maintenance of your project.
Giving an error: Could not find or load main class ………..
show your class, show where it is, show the command
it's java Arrays.ArrayListExamples
