How to run compiled java project from console, not from IntelliJ

前端 未结 3 855
广开言路
广开言路 2021-01-29 09:47

After the the demo project is compiled, there are many .class file in the out>production>testPrj>apidemo. Basically, each file will have one .class file

I expect to ente

3条回答
  •  面向向阳花
    2021-01-29 10:05

    For running from console you have to do few things:

    • to be sure that your class apidemo.ApiDemo has main() for lunching your program.
    • compile sources - navigate to folder where is source file located (it has already compiled by Intellij):

      javac ApiDemo.java

    • run compiled files with .class extension, providing full class name (with packages):

      java apidemo.ApiDemo

提交回复
热议问题