Answer the question
In order to leave comments, you need to log in
How to compile application into one file?
I am creating a project. Through Project Structure I connect the necessary libraries. I write the code, and I press Build Project. All without errors. Works.
As a result, the Main.class file is located in the
C:\Users\alexey\IdeaProjects\app2\out\production\app2\com\company
folder. I cut it into C:\tests
But I can't run it from the command line
C:\tests>java Main.class
Error: Could not find or load main class Main.class
Caused by: java.lang.ClassNotFoundException: Main.class
Answer the question
In order to leave comments, you need to log in
Do I understand correctly that at the time of creation, I should get one file at the output
complete and independent
At the top of my project it says
package com.company;
I want to run from C://Main.class drive
Why isn't my Main.class running?
java -cp . com.company.Main
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question