• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difficulty in understanding the the way the code is compiled in the book

 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I had been reading java from the book "Head first Java" for some time. But I had really had not paid attention to the way the code was compiled when i was readind core java for the past one and a half month. The way the code has been compiled left me confused as i started reading RMI in the book.
I know that code is compiled on the command prompt.For instance, if i wrote a program by name "Hello" and saved it in a folder say, "jfiles" in the c drive, I compiled it as "c:\jfiles>javac Hello.java"

But the book shows a command prompt which dispays "% javac Hello.java".
Besides, in the rmi chapter, to start the rmi registry, the DOS prompt merely displays "% rmiregistry" which did show any result, but when I wrote "start rmiregistry" under the folder in the DOS prompt where i had created the files, a seperate rmiregistry DOS prompt opened up.
I'am facing problems in understanding the way the code is compiled in the book. Is the code being compiled on a windows DOS prompt or any other OS. What does the symbol "%" before every command interpret. I'am unable to proceed further in RMI.
I'm sorry to ask you after coming halfway through the book. I shall be grateful if you can explain me clearly.
Thanks in advance,

regards,
Komal
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the examples in that book are from a unix machine (they certainly aren't Windows). The % is just the command line prompt - the equivalent of the c:\jfiles> on your machine.
 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks loads for your prompt reply.
But don't they write codes in folders or directories in Unix (as you said). But don't they use folders and directories to store programs. How can the JVM decipher the location of the code if you don't show the path.

Thanks again

regards,
Komal
 
Parambir Singh
Ranch Hand
Posts: 40
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
% is the prompt for the Mac OS.

It isn't required to display the path on the command prompt. It is only for the help of the user who is typing. The computer "knows" which folder you are in and runs the command in that folder itself.

You can configure the command prompt on Mac to display the path as well. Most people don't do it. It's just a matter of taste. To know which directory you are presently in, you can use the 'pwd' command. It stands for 'present working directory'

Hope it helps!
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Param",

Please read your private messages regarding an important announcement.

Thank you,

Rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic