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

后端 未结 12 1270
梦如初夏
梦如初夏 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条回答
  •  感情败类
    2020-12-01 08:12

    Suppose you did cd C:/projects and HelloWorld.class is in C:/projects/com, then just type:

    java com.HelloWorld
    

提交回复
热议问题