How to compile java package structures using javac

前端 未结 5 623
逝去的感伤
逝去的感伤 2020-11-29 06:20

I am trying to compile (from the command line) a java package that imports another package of my own. I was following a tutorial online but it seems that I get an error when

5条回答
  •  清歌不尽
    2020-11-29 06:34

    delete your package folder (after pasting you code to some other folder) and then locate to the folder in cmd where you current code is and try javac -d . Helloworld.java (this will create the Helloworldclass and subpackage as well) and try same for you mainfunction code ie Callpackage.java after compiling to run the code try java Callpackage

提交回复
热议问题