How to run a .class file that is part of a package from cmd?

后端 未结 12 1260
梦如初夏
梦如初夏 2020-12-01 07:11

I keep getting errors when I make my .class part of a package and try to run it from cmd.

Here\'s the code that works after using jav

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 08:09

    Run the program from the parent directory of the com directory.

    java com.HelloWorld
    

提交回复
热议问题