Compile and execution w/packages involved
Posted: Sun Jun 04, 2023 12:41 pm
Hi, I'm on chapter 4.5.1 and learning about compiling and executing a program via the CMD when there are packages involved and I was also watching a video for this topic on youtube and just had a question.
So in the youtube video, he does it as follows:
Javac -d . Hello(this is the class he used).java
then he does
Java one(this was his package).Hello
As you can see, the first line he inputs into the CMD is exactly what you said to do in the book. But if you look at the second line, while it is similar, he doesn't add "-classpath ." before doing the package.class format... and this is what you put in the book.
Just wanted to reach out and have this question rectified!
So in the youtube video, he does it as follows:
Javac -d . Hello(this is the class he used).java
then he does
Java one(this was his package).Hello
As you can see, the first line he inputs into the CMD is exactly what you said to do in the book. But if you look at the second line, while it is similar, he doesn't add "-classpath ." before doing the package.class format... and this is what you put in the book.
Just wanted to reach out and have this question rectified!