How to download and install Java 8.
Following are steps to install Java in Windows
2) Installation of eclipse IDE
So far, you've configured your environment, installed the Atlassian SDK, and created a HelloWorld plugin project. You've tweaked the plugin project a bit but it has no modules so other than live in the UPM, it does nothing. Of course, you've done all this on the command line - most programmers prefer the advantages of an IDE. So, on this page, you configure the Eclipse IDE to work with the SDK, import HelloWorld and add some functionality.
Step 1: Install the Eclipse IDE
In this step, you download and install the Eclipse IDE for Java EE Developers (Indigo). This version of Eclipse comes with most of the Maven dependencies already installed. Do the following to install Eclipse in your system: Download the Eclpse IDE for Java EE developers. This IDE has many of the dependencies required by the Maven Eclipse plugin. The Maven Plugin to be downloaded is not compatible with Eclipse Kepler or Indigo, so download the Luna edition. Move the tar file into your home directory. Expand the tar file.
Step 2: Start Eclipse and update the Installed JREs
Now you are ready to start Eclipse.
1. Change directory to ~/eclipse.
2. Run the Eclipse program by typing:
. / eclipse
Eclipse prompts you to identify the location of your workspace.
3. Enter the location of the atlas tutorial directory.
4. Open the Eclipse > Preferences dialog.
5. Filter for or navigate to the Installed JREs page.
6. Make sure that the checked JRE comes from the JDK 1.6.
Step 3: Install the Maven Eclipse Plugin
Start Eclipse and do the following:
1. Choose Help > Install New Software from the menu bar. The Available Software dialog appears.
2. Click the Add button. The Add Repository dialog appears.
3. Enter Sonatype M2Eclipse in the Name field.
4. Enter http://download.eclipse.org/technology/m2e/releases in the Location in the field.
5. Press OK to close the dialog. The system searches the site for the plugin. After a moment, the Name field fills with the Maven Integration for Eclipse.
6. Check the box and press Next.
7. Select the Maven Integration for Eclipse.
8. Press Next and Next again.
9. Accept the terms of the license agreement and press Finish. Eclipse calculates the dependencies and space
10. Press Next.
11. Accept the License agreement and press Next
12. Press Finish. The installation procedure runs.
13. Restart Eclipse when prompted.
Step 4: Configure the Maven Plugin
After Eclipse has restarted, configure it to use the Maven Eclipse plugin you just installed.
1. Choose Window > Preferences from the Eclipse menu bar. The system displays the preferences dialog.
2. Filter for or navigate to the Maven > Installations page.
3. Click the Add button. The Maven Installation dialog displays.
4. Browse to your /usr/share/atlassian-plugin-sdk- 5. Press OK.
The system sets this external repository for you. The dialog should look like the following: 6. Ensure the Global settings are coming from the installation directory.
7. Press Apply.
8. Click the Maven root.
9. Uncheck Download repository index updates on startup.
This prevents Maven from updating on Eclipse start up, which can be time-consuming. The atlas- commands update the repositories for you.
10. Press OK to close the dialog. The Next Steps You've got Eclipse set up and configured. Now, you can import your project into Eclipse and use the Atlassian SDK with it.
3. Setting path for JAVA HOME If you see a screen like below' Java is installed. This instructable will teach you how to:
1. Install the Java Development Kit.
2. Set system variables to easily be able to compile and execute java files.
3. Compile and execute a Java file from Command Prompt.
Save the file as helloworld.java
Make sure "Save as type" under where you typed the file name as "All Files" (as opposed to the default "Text-File").
You want to save your java file where the Command Prompt is set to open at.*
*Such as C:\Users\Home
Summary: By the end of this tutorial "Java Data Type Casting Type Conversion", you will be comfortable with converting one data type to another either implicitly or explicitly.
Java supports two types of castings – primitive data type casting and reference type casting. Reference type casting is nothing but assigning one Java object to another object. It comes with very strict rules and is explained clearly in Object Casting. Now let us go for data type casting.
Java data type casting comes with 3 flavors.
1. Implicit casting(widening conversion)
A data type of lower size (occupying less memory) is assigned to a data type of higher size. This is done implicitly by the JVM. The lower size is widened to higher size. This is also named as automatic type conversion.
In the above code 4 bytes integer value is assigned to 8 bytes double value.
2. Explicit casting (narrowing conversion)
A data type of higher size (occupying more memory) cannot be assigned to a data type of lower size. This is not done implicitly by the JVM and requires explicit casting; a casting operation to be performed by the programmer. The higher size is narrowed to lower size.
In the above code, 8 bytes double value is narrowed to 4 bytes int value. It raises error. Let us explicitly type cast it.
The double x is explicitly converted to int y. The thumb rule is, on both sides, the same data type should exist.
3. Boolean casting
A boolean value cannot be assigned to any other data type. Except boolean, all the remaining 7 data types can be assigned to one another either implicitly or explicitly; but boolean cannot. We say, boolean is incompatible for conversion. Maximum we can assign a boolean value to another boolean.
Following raises error.
In the above statement, left to right can be assigned implicitly and right to left requires explicit casting. That is, byte can be assigned to short implicitly but short to byte requires explicit casting.
Following char operations are possible
Run a java program from command Prompt.
Step 1: Download Latest JDK
Step 2: Setting Path for Command Prompt
* If you have a later JDK ( i.e. JDK 1.6.0_22) replace the portion that says jdk1.6.0 with it.
** If you don't know which jdk you have to go to start pane( at bottom left corner of your screen)>click run> click browse>Then go to C:\Program Files\Java.
*** Do not type quotation marks in steps 1-3 at the command prompt.
Step 3: Creating a Simple Java Program
public class helloworld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Step 4: Compiling and Executing the Program
7. Type Conversion, Type Casting
int x = 30; // occupies 4 bytes
double y = x; // occupies 8 bytes
System.out.println(y); // prints 10.0
double x = 30.5; // 8 bytes
int y = x; // 4 bytes ; raises compilation error
double x = 30.5;
int y = (int) x;
boolean x = true;
int y = x; // error
boolean x = true;
int y = (int) x; // error
public ClassDemo1
{
public static void main(String args[])
{
char ch1 = 'A';
double d1 = ch1;
System.out.println(d1); // prints 65.0
System.out.println(ch1 * ch1); // prints 4225 , 65 * 65
double d2 = 66.0;
char ch2 = (char) d2;
System.out.println(ch2); // prints B
}
}
All the data type conversions
byte TO short int long float double char boolean short TO byte int long float double char boolean int TO byte short long float double char boolean float TO byte short int long double char boolean double TO byte short int long float char boolean char TO byte short int long float double boolean boolean TO byte short int long float ouble char String and data type conversions
String TO byte short int long float double char boolean byte short int long float double char boolean TO String