Tuesday, December 24, 2013

JAVAP,JAVAH,JDB Usage



  • javap - The Java Class File Disassembler




For example javap -c  -classpath  C:\Users\Srikanth\Desktop\blog MyInput


  • jdb - The Java Debugger

jdb helps you find and fix bugs in Java language programs.



  • javah - C Header and Stub File Generator

javah produces C header files and C source files from a Java class. These files provide the connective glue that allow your Java and C code to interact.


For example javah -classpath C:\Users\Srikanth\Desktop\blog MyInput

Monday, December 23, 2013


Java is one of the widely used programming languages for developing all kinds of applications.
It might be because of the following reasons

  • Simple  --it is  very simple to use /implement
  • Robust  --it is 
  • Platform Independent 
  • Portable

When we write a java program which is in human readable format(.java file) is converted to machine readable format(.class file) and this process is called compilation.
javac is java compiler which does this process.


JAVA Installation and Setup


  • Download the jdk latest version from oracle.com
  • After downloading the jdk(java development kit)  if you try to execute the javac in command line it will not work because operating system does not know where the javac is present.



  • Set the required environment variables

I have installed my JDK in F drive.So i have appended the location value of javac to PATH environment variable as set PATH=%PATH%;F:\JDK\bin
So,In order to inform operating we need to set the  path variable to location of javac.

But one disadvantage of this method is every time you  open a new window you have to execute the above command.

So ,the better option is to add PATH environment variable ,by following this
 "My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path". I saved it.





Make sure that there are no extra spaces after the required path(if extra  space is there then it will not recognize javac command).

And there is also another option just save the command set PATH=%PATH%;F:\JDK\bin   in .bat file
and execute it every time when you tried to run javac command or any java program.







Message

Hi All,

I'm writing this blog in order to share my knowledge and also to stay in touch of all the concepts based on the advice of one my dearest friend.