Monday, August 26, 2013

To execute the java program from command line...


How to configure Editplus to create, compile, run Java program ?

To run Java programs there might be many IDEs like NeatbeansEclipse ,but as a beginner it is highly recommended to use Text Editor to Create,Compile and Run Java programs
Here it is provided how to set Editplus to compile, run Java programs.

You ca download it by clicking Editplus .
Download both the files EP2SETUP.EXE and KEY.txt.
Follow the steps below...

Step 1: Double click on the downloaded EP2SETUP.EXE file and install it normally
            Open the KEY.txt and activate Editplus.

Step 2: Now to configure the Editplus see the screen shots.
         
            Click on the Tools.


            Click on the Configure User Tools... , you will get a window like this

       
              Click on Group Name , you will get window 


             Change the New name to "JAVA" , click on OK. You will get a window..


             Click on the Add Tool >>"


            Change name in the Menu text to "Compile" and give copy the path of  javac.exe file in
             Command. By default the path will be "C:\Program Files\Java\jdk1.7.0_25\bin\javac.exe" and                choose the Argument as  File Name and Initial Directory  as File Directory. 
            You should see like this


              Click on Apply .
              Repeat the same procedure by clicking Add Tool >> , changing Menu text  to "Run", and 
              give the copy of path of  java.exe file in  Command. By default the path will be 
              "C:\Program Files\Java\jdk1.7.0_25\bin\java.exe" and choose the Argument as 
              File Name Without Extension and  Initial Directory as File Directory.
              You should see like this


             Click on Apply button.  
             Now you have to do the same procedure above by mentioning Menu text as "javap" and the 
             in the Command you have to give javap.exe file path, by default it is 
             "C:\Program Files\Java\jdk1.7.0_25\bin\javap.exe"  and the Argument as 
             File Name Without Extension and Initial Directory as File Directory.


                Then last but not least you have to give the Command Prompt  to the group as a program.
                Click on Add Tool>> change Menu text to "cmd" and give the path of cmd your system,
                by default it will be "C:\Windows\System32\cmd.exe" and leave the Argument and 
                Initial Directory empty and click OK
              


             That's all you have to do with configuring Editplus and you will get like this.,


Step 3: Now create a java file and save it in any where in your system and 
            To compile ---- Ctrl+1
            To run-----------Ctrl+2
            To know what is that present in compiled code  ----- Ctrl+3
            To execute from command line arguments -----------Ctrl+4            
           
 Thank you for reading this post, any queries you can comment with out any hesitation.


Sunday, August 25, 2013

How to get Java Development Kit (JDK 7) on my pc ?

The JDK 7 includes tools useful for developing and testing programs written in the Java programming language and running on the Java platform.



you can download JDK from here



Follow the steps below for a perfect installation:

Step 1 :  Identify the file which suits your system (Windows 64(x64) bit or 32(x86) bit).
              for Windows it will be available at the last.


Now click on the  Click on the Accept Licence Agreement



and then click on the download button 

Step 2 : Run the downloaded file as the administrator.
             run on the file which suits your OS.

Step 3: The installation should be done as follows...



           Click on Next> button


            If you want to change the installation directory click on Change... and give your desired
                  directory path. Or it is recommended to leave the default path like that and click Next>



            the installer will do its job of removing any old files and installs new files or else it will end
                   up normally and click on Finish or Close at the end.

          Installation has completed.


Step 4: Now it is time to set Environment Variables  to the system.
            Just follow the figures shown :



          You can see the installation directory as above . Copy the path of bin folder from here , that is
                 by default it will be "C:\Program Files\Java\jdk1.7.0_25\bin".
         
           After this step click on Start and right click on Computer and click on Properties
                  You will get a window and to the top left it look like this


           Click on Advanced system settings , you will get this window


           Then click on Environment Variables , you will get this window

             Now in the bottom box of System variables search for variable path .


             Now click on Path and click on Edit... , you will get the window like this,


             Now at the end of the Variable value add the path of the bin folder, by default it
                   is "C:\Program Files\Java\jdk1.7.0_25\bin;".Don't forget to keep ';'
                   at the end of the statement. Click on OK .

              Now we should create a new System Variable with the name "CLASSPATH"
             
               Click on the New... you will get a new window 

     
               Create a new Variable name with "CLASSPATH" and the Variable value with 
                          the following path "C:\Program Files\Java\jdk1.7.0_25\jre\lib\rt.jar;"
you can see the file path here.


               you should do like this ,


                After creating this press OK. And close all the tabs.
                Now you are done with installing Java.

The next step is to set up Editplus for Java programming.