Showing posts with label BASICS. Show all posts
Showing posts with label BASICS. Show all posts

31 March 2014

How to install Java on windows

How to Install Java in Windows 7

Java

1. First check whether Java is installed or not in your system.
  • Open MyComputer > Local Disk C: > Program Files > Common Files  and see if a folder named "Java" is present.
  • If the "Java" folder is present then you need to check if "environment variables path" is set or not
  •  If java dose not exist then you need to download  java jdk from Oracle website. Accept license agreement before downloading. Select your os(32 or 64-bit) and download. 
  • Java is open source software. It provides free download to the users and developers.
  • There are two kinds of java packages, one is jdk :- Java Development Kit, and other is jre:- Java Runtime Envirement
  • JDK:- It is used by developers to develop java based programmes like standalone(Disktop) and server applications.
  • JRE:- Is used to by the operating system to run java applications in the local computer.
  • JRE will convert java bite code instructions to system understandable Machine code which is executed by the system.
  • To download java for free click below link

Download and install java jdk. 
  • Install Java from the download.
  • Now Installation is successfull but its not yet over,  you need to set environment variables
  • Open command prompt and type javac in command line.
  • Then it shows 'Javac' is not recognized as an internal or external command.checking-for-java
  • You need to set environment variable path to avoid this java error.
  • In order to set path right click on Computer and click properties there you can find advanced system settings on left side pannel of the window.
    MyComputer-propertiesAdvanced-System-Settings

  • Now click on Advanced tab.
  • Under Advanced tab click environment variables button as shown below.



System-Properties

  • On clicking the button you find a Environment Variable popup.
  •  Now under User variables click "New" and set 
  • variable name : PATH and variable value : C:\Program Files\Java\jdk1.7.0\bin .
  • Then click OK.
  • Now again open command prompt to check if java is installed or not.
  • To do this you need to type javac on the command line It will show all java commands as shown in below image.It means that java has been successfully installed on your computer.


check-for-java

  • Now you can use notepad to write the code or download any IDE(Integrated Development Environment) and start programming(Starting with eclipse).
       Check this: Java programmes for beginners

19 February 2014

Coding Tools

Notepad
  • Notepad can be used to write and edit java code.
  • The notepad file must be saved with '.java' extension.
  • Name of the file must be same as that of the class being written in it.
  • This file can be accessed with command prompt and can be compiled and run.
  • cmd to compile java file : javac <space>filename.java
  • If it shows no errors then the command to run java file is : java <space> filename

 Writing java code can be made simple using IDEs. A number of java IDEs are available on internet
Some of the IDEs for programming java are:
  • Eclipse
  • Netbeans
  • BlueJ
  • JCreator
  • IntelliJ Idea
  • JBuilder
If you are a beginner in programming then it is good to start practicing with notepad or else you can go with IDEs.

Out of all these IDEs Eclipse is the most preferrable one.It is a free software.You can download Eclipse at Download Eclipse                         
     

Starting with Eclipse

  • After downloading the eclipse IDE you need to extract the .ZIP file in to a folder in which you can find eclipse loader(eclipse.exe)
  • Now click on eclipse.exe and authorize the security warning(click run). You will be asked to select a workspace where all your eclipse files will be saved. Click browse and select a new empty folder and click OK.
  • Eclipse starts with a welcome screen. now open window > open prespective > java. Now you are ready to create and work with projects.

HOW TO CREATE A NEW PROJECT AND NEW CLASS. 

  • Goto File > new > Java Project and give some name to your project and click ok.
    New-project

  •  You can see your project created below the package explorer window on the left.
    Package-explorer

  • To create a new class right click on the project you just created select new and again select class.
    New-class

  •  A window appears in which name of the class is given(First letter of the class in CAPITALS). Check the box as shown below and click finish.
    class-details
  • Now a java file is created with a class name same as file name. Main method is also included in it.
  • The code that is to be executed is written inside the main method.

Contact Form

Name

Email *

Message *

Smooth Graphics Java

// Arrange Bricks in Game //java brick breaker game code without flickering // added game levels 1,2,3 in the game //java paddle ball ga...