0% found this document useful (0 votes)
52 views

Java 1 Assignment

Uploaded by

yash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Java 1 Assignment

Uploaded by

yash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Assignment No.

Aim :- Study of different modern tools and Installation of JDK and Java
IDE, like Netbeans or Eclipse

What are Java Tools?


Java provides a wide range of tools for different parts of the development process, from
coding to launching applications. Some tools are included in the Java Development
Kit (JDK), while others are third-party tools developed by the community or other
companies. Java has a variety of tools to enhance application efficiency, code quality, and
overall productivity of the application. Following are the Java tools that can be extremely
useful for Java developers.

Top 10 Tools and Technology in Java


Explore the top 10 essential tools and technologies shaping Java development, offering
efficiency, innovation, and robust functionality.

1. Integrated Development Environments (IDEs)


Integrated Development Environments (IDEs) are software applications that provide a
comprehensive set of tools for developers to write, edit, debug, test, and deploy code more
efficiently. The IDEs for Java typically refer to a space where developers can write and
edit Java code, fix errors by debugger, and directly compile and run Java applications from
within the IDE, by testing of code. Below are the popular IDEs for Java.

1.1. Eclipse

A popular open-source Integrated Development Environment (IDE) with vast


plugins and community support, those are primarily used for Java development.
Whereas, the Eclipse IDE also supports other languages as well. Eclipse remains
one of the most popular Java IDEs in the world, largely because of its flexibility, as
it’s free to use (open-source), and the promotes a strong community.

1.2. Intellij IDEA

IntelliJ IDEA is an Integrated Development Environment (IDE) developed


by JetBrains, whereas it supports a wide range of programming languages, it’s
particularly favoured in the Java community. There are two main editions of IntelliJ
IDEA: the Community Edition, which is free and open-source, and the other one
is Ultimate Edition, which is a paid version with additional features. It is developed
by JetBrains which offers both a free community version as well as paid ultimate
version with more functionalities and features. It is another highly popular
IDE from JetBrains, known for its intelligent code completion and rich set of
features.
2. Build Tools and Dependency Management
The build tools that automates the process of compiling, testing, documentation, automation
that basically provides the consistent build process for the application, and packaging Java
applications. Following are the build tools and dependency management.

2.1. Maven

Maven is both a build tool and a dependency management tool. Its configuration file is
‘pom.xml’ which lists project dependencies, where maven automatically downloads all the
dependencies from the repositories. Maven handles the building, reporting, as well as
documentation of the projects, it provides a lot of dependencies for the Java applications.

2.2. Gradle

Apart from what Maven offers, Gradle lets the developers create the custom build tasks
using Groovy. Gradle processes the build through a lifecycle that includes tasks like
initialization, configuration, and execution, whereas It fetches required libraries from
repositories like Maven Central or JCenter, or even custom repositories.

3. Version Control System


The Version Control System (VCS) is the tool which is used in software development for
the tracking and managing of the changes that have been done in the codebases. It allows
multiple developers to work on a project simultaneously without overwriting each other’s
changes and helps to maintain a proper record of code modifications. The popular Version
Control System (VCS) used in Java is described below:

3.1. Git

Git is the Currently the most popular VCS, and platforms like GitHub, GitLab,
and Bitbucket are built around Git. It is mainly used to track changes in source code during
software development, allowing multiple developers to collaborate on a project.

4. Continuous Integration/Continuous Deployment (CI/CD)


The Continuous Integration/Continuous Deployment is a fundamental concept in
modern software development, including projects written in Java, where CI refers to the
practice of frequently integrating code changes into a shared repository. When developers
push their changes to the shared repository multiple times a day to the master branch, then
after each push, their automated tests run to verify these changes to ensure that they don’t
break the existing codebase in the actual repository. Whereas, the Continuous Delivery
ensures that the codebase remains in a deployable state after each and every change done by
the developer, as well as Continuous Deployment is where every change that passes the
automated tests is automatically deployed to production, without manual intervention.
4.1. Jenkins

Jenkins automates the building, testing, and deployment of applications. If you have a
web application, Jenkins can be set up to automatically deploy your application to a server
whenever you push your changes to your repository.

4.2. Travis CI

Travis CI Integrates with GitHub. When you submit a pull request on GitHub, Travis CI
can automatically run tests and report if they pass, and shows you that your working tree is
clean with nothing to push.

5. Testing Tools
Testing tools are the tools which support various types of testing, ranging from unit testing
to integration testing and beyond that build the test cases according to the boundary
conditions of your application. Some of the testing tools that are mentioned below.

5.1. JUnit

JUnit is used for writing and executing the unit tests in Java, it builds the test case as
per the application. Basically, JUnit is a tool in Java that lets developers write test cases to
check if their code works fine as expected. By using JUnit, you can quickly find mistakes
or issues in your code and fix them.

6. Static Code Analysis Tools


This tool examines the Java code without actually executing. Basically, they spot mistakes
or parts of the code that might cause problems later, the main purpuse is they catch issues
so you can fix them before they cause bigger problems. So, these tools consider for
patterns, code structures, or configurations that might lead to errors, inefficiencies, or
security vulnerabilities. The main goal is to improve code quality and maintainability by
catching issues early in the development process.

6.1. SonarQube

It checks the coding standards for the application, the refinement of the code, the clarity of
the code, potential bugs, and security vulnerabilities. It manages the code quality by
scanning your code to identify the bugs. For example: a part of your code that might break
because it’s looking for something that’s missing.
7. Application Profilers
The Application Profilers is the diagnostic tool which is designed to analyse the pattern of
Java applications, and monitors the runtime behaviour of your Java applications. It
identifies the performance bottleneck, memory leaks, thread contention, and there some
issues which can affect the efficiency as well as stability of the program. Some of the
profilers are describe below.
7.1. VisualVM

It tells how your Java application is running, showing metrics like memory usage and
active threads, and if your application is using an unexpected amount of
memory, VisualVM helps to identify the cause. It is a free tool that is bundled with the JDK
(Java Development Kit), that offers basic profiling capabilities for both local and remote
JVMs (Java Virtual Machine).

7.2. NetBeans Profiler

It is integrated into the NetBeans IDE, this tool provides CPU, memory, and thread
profiling capabilities.

8. Database Management/ORM (Object Relational Mapping)


It is the tools and techniques which are used to interact with the databases more easily
and efficiently. It’s all about handling and organising data in the databases. In Java, it uses
specific tools or such libraries to connect with the databases, it reduces the redundancy of
the code or queries, and manage data in databases by using any of the database
like MySQL, Oracle, or PostgreSQL. Whereas ORM stands for Object Relational
Mapping, in ORM where all the Java objects (or classes) are mapped or linked into the
database in the form of tables and this task is automatically done as we used JPA in spring
boot Java , instead of writing complex and raw SQL queries, developers can work with
these objects, as well as the ORM tools will handle the database interactions automatically.

8.1. Hibernate

It allows Java applications to interact with databases using objects instead of writing
complex SQL queries into the databases. For example: If you make a ‘User’ in
Java, Hibernate can directly put it into a “users” database section without you having to
type out detailed database commands.

8.2. JPA (Java Persistence API)

JPA is a set of rules or guidelines that describe how Java objects should be stored, updated,
deleted, and retrieved from relational databases. It standardised the way, Java applications
interact with databases using ORM (Object-Relational Mapping).

9. Web Development and Application Servers


Building web apps with Java means making the online programs using Java. These can
be simple sites or big online systems developed by the Java developers. In Java, ‘Servlets’
are used to manage the website requests and give back responses. As the ‘JavaServer
Pages’ (or JSP) allows you to mix the Java into web pages to make the changes based on
user or information, and adjust according to the data. There are many tools in Java for this,
like we use Spring MVC, JSF, and Struts. Java is popular for making web services, which
are ways to communicate through the services. This includes both SOAP and REST types,
there are special Java tools, like JAX-RS (for REST) and JAX-WS (for SOAP).
9.1. Spring Boot

Spring boot makes the development part easy for the Java techies, as it has user friendly
interface where developer, develops different kinds of microservices using the STS (Spring
Tool Suit) tool, and let services to communicate with each other by building the Eureka
Server, by using the Spring Boot developer can quickly set up the web server and can add
dependencies according to their requirements, and can define the endpoints or API into
their microservices for the Java application, and easily interact with the databases.

9.2. Tomcat

Tomcat is like a helper for Java websites. You give it your Java site, and Tomcat runs it for
you, and tomcat ensures it operates smoothly, managing user interactions and overseeing
the incoming and outgoing communications. Tomcat is like a manager for Java web apps,
where it runs properly, handling all the user interactions for you as well as it will handle the
requests and responses.

10. Containerization & Orchestration


Containerization is like putting a Java program and all it needs into a special box.
This ensures the program acts the same everywhere. This ensures the application runs the
same, regardless of where the container is deployed meaning that you can package or
integrate. Basically it is like the program works the same no matter where you use the
box. For instance, you can put a Java program its tools, and the other needed items into this
container, now when you opens the box, it’s like the Java program has its own special space
to run, this means the app works the same wherever you use this box.
Now, Orchestration comes into the role play when you have multiple containers that
need to work together, or they need to talk to each other or change in number based on
users, here the orchestration helps in managing this. For instance, if one box has the main
website and another stores data, the orchestration tool ensures they work together properly.
Let’s take another example, if your Java program is in two boxes, one for the main site and
another for saving data, an orchestration tool helps these boxes for talking or
communicating with each other and manages them.

10.1. Kubernetes

Kubernetes is something which controls, and organizes the Docker containers. Suppose, if
you have an online application that gets busy having load of traffic, or quiet based on user
visits, now the Kubernetes can add more versions of your application during busy times and
lessen them during quiet times.

10.2. Docker

It lets you to putting your application and all its stuff, and everything into a box, called a
special box or a container. If your application needs certain tools or versions to work, or
certain things to run, the docker makes sure it works the same way in every place you use
it. As It should works the same everywhere, whenever you opens that box/container. It
basically, package your application and its dependencies into a container. If your
application requires specific versions of libraries, then Docker ensures it runs consistently
across different environments.

Java JDK Download


The JDK can be installed on the following Platforms:
1. Microsoft Windows
2. Linux
3. macOS

Install JDK on Microsoft Windows

Step 1: Download and Install Java Development Kit (JDK)


The very first step is to download the Oracle Java Development Kit (JDK) from the
Official Oracle Website. For that, Head over to the Official Website.

You need to identify your system specifications to choose the Product/file description. The
website will contain the latest version for your corresponding system. For Windows, we’ll
be downloading the latest x64 Installer of Java SE Development Kit 18. After the
download is complete, proceed to install the JDK by following the bootstrapped steps.
Step 2: Configure Environment Variables
After the installation is complete, we have to configure environment variables to notify the
system about the directory in which JDK files are located. Proceed to C:\Program
Files\Java\jdk-{YOUR_JDK_VERSION}\bin (replace {-} with your JDK version)

To set the Environment Variables, you need to search Environment Variables in the Task Bar
and click on “Edit the system environment variables”.

Under the Advanced section, Click on “Environment Variables”.


Under System variables, select the “Path” variable and click on “Edit”. Click
on “New” then paste the Path Address i.e. C:\Program Files\Java\jdk-
{YOUR_JDK_VERSION}\bin. Click on “OK”.

Now, in the Environment Variables dialogue, under System variables, click


on “New” and then under Variable name: JAVA_HOME and Variable value: paste
address i.e. C:\Program Files\Java\jdk-{YOUR_JDK_VERSION}. Click on OK => OK
=> OK.
Step 3: Check the Java Version
Open Command Prompt and enter the following commands

java -version
javac -version

Setup Java with Eclipse IDE

Step-1: Download Eclipse IDE

In order to set up Java with Eclipse IDE, you have to download the latest eclipse IDE
package from their official website. The current set up is performed using Eclipse IDE 2021-
12.
Download the coding pack for Java - Windows i.e. eclipse-inst-jre-win64.exe (name may
change later).

Step-2: Start the Eclipse IDE Installer

Now, double click on this installer. So, you will see the screen below. In order to install
eclipse, click on the Run button.

On the next screen, you will see many different packages for Eclipse. Make sure you install
the Eclipse IDE for Java EE Developers package.
Step-3: Configure Installation Location
By default, It will show the path for Java VM and Installation folder. However, if you want
you can select an appropriate path for Java VM and Installation folder. Now, click on Install.

Step-4: Launch Eclipse IDE

Now, Eclipse IDE is installed successfully on your system. Click on Launch to start the
Eclipse. Moreover, you can also start the application from the start menu or Desktop icon.

Step-5: Configure Workspace

The Eclipse workspace is a collection of projects, settings, and preferences. It is a folder


where Eclipse stores this information. You must create a workspace to start using Eclipse.
You can create multiple workspaces, but only one can be opened at a time by one running
instance of Eclipse. However, you can launch multiple instances of Eclipse with different
workspaces.
Now time to Launch our Eclipse IDE

You might also like