File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Difficulty in understanding the the way the code is compiled in the book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Difficulty in understanding the the way the code is compiled in the book" Watch "Difficulty in understanding the the way the code is compiled in the book" New topic
Author

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

Komal Amaresh
Ranch Hand

Joined: Oct 06, 2008
Posts: 67
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

Joined: Aug 05, 2005
Posts: 3169
    
  10
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.


Joanne
Komal Amaresh
Ranch Hand

Joined: Oct 06, 2008
Posts: 67
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

Joined: Sep 05, 2004
Posts: 40

% 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!


SCJP, SCMAD
http://parambir.me
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

"Param",

Please read your private messages regarding an important announcement.

Thank you,

Rob


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difficulty in understanding the the way the code is compiled in the book
 
Similar Threads
Running compiled code
problem with "rmi.server.codebase"
Is this the place to ask installation questions?
Running Java Programs from the command prompt
Java beginning