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!
Compile and execution w/packages involved
Moderator: admin
-
- Posts: 12
- Joined: Sun May 28, 2023 1:17 pm
- Contact:
-
- Site Admin
- Posts: 10325
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: Compile and execution w/packages involved
What is the question? The book shows the right and complete way.
If you like our products and services, please help us by posting your review here.
-
- Posts: 12
- Joined: Sun May 28, 2023 1:17 pm
- Contact:
Re: Compile and execution w/packages involved
In the video I watched, the person did almost the exact same steps as you, like I outlined above, but you added the "-classpath ." while he did not, and still compiled and executed the program
I know on the next page you mentioned what "-classpath ." is but I wasn't able to really grasp what it does so just wanted your help on it
I know on the next page you mentioned what "-classpath ." is but I wasn't able to really grasp what it does so just wanted your help on it
Who is online
Users browsing this forum: No registered users and 3 guests