How to run java program in command prompt,created by intellij

前端 未结 6 1238
余生分开走
余生分开走 2021-01-01 10:53

How do I run my Java program in command prompt, my project was created in Intellij, and I am having difficulties running it in the command prompt...without using the Intelli

6条回答
  •  清酒与你
    2021-01-01 11:45

    From intellij, open your project structure, and click on Modules. You'll be able to see the output path. Usually, it's something like (if on mac):

    ~/../out/production/{context}.
    

    Back to your example in windows. The path you gave is, C:\myjava\sampl1\src\com\myexample\test>, so you have your project in : C:\myjava directory where your context (or project name) is sampl1. That means that your output (*.class files) will be in

    C:\myjava\sampl1\out\production\sampl1
    

    Navigate into the folder and then run the command: java com.myexample.test.myjava

提交回复
热议问题