Category: Java Application

DEBUNKING THE MYTH: EXPLORING JAVA 9 MISCONCEPTIONS

Java is doubtlessly one of the top-most programming languages in the world. Despite its beginning as a program for set-top boxes, it remains one of the most widely used languages. It is not just preferred by programmers and coders, it is also a popular language when it comes to teaching programming languages in schools and universities.

But Java also comes with too much of myths and misconceptions. Some of it is inevitable with a popular language where murmurs on its features and efficiency become Chinese whispers. But some also stock from its beginning as a simple language that looked too good to be true. Its creator’s bold announcement of “write once, run anywhere” was considered a bit too revolutionary.

Although Java has come far since its starting – now with Java 9, the misunderstanding surrounding it is still quite prevalent. This is despite the fact that many programmers chose to keep working on Java and you can easily hire java developers for enterprise application development.

Let’s check some of these myths:

Java is dead

We’ll call this is the strangest myths regarding Java that refuses to die down despite the fact that rates among the top programming languages used across the world. Don’t take our word for it. Check out the RedMonk Programming Language Ranking the TIOBE index which has repeatedly found Java among the topmost popular languages. Java remains alive and thriving.

Read Also: Java Developers Are Available For Hiring In Most Offshore Development Companies

Java is slow

This one has some basis in truth and it stems from the JVM or the Java Virtual Machine. One of Java’s USPs was “write once, run anywhere”. But this depended on the JVM that gave it the cross-platform portability. But JVM also meant an additional infrastructure layer, which would obviously slow down the entire process. In addition, some early JVMs were actually pretty slow.

But the scenario is quite different now. The new JVMs are quite fast. The speed of our hardware also means that the delay is negligible. It may matter in applications where every second counts, but for most applications, Java’s speed is a complete non-issue.

Java suffers no memory leaks

When we compare it with C and C++, Java seems pretty foolproof against memory leaks. In the other two languages memory leaks can occur anytime there is an error in allocating the location. Since this is done by the programmer, simple human error makes the possibility of a memory leak ever-present. Java removes the human factor by automating memory management. The garbage collector later does the clean-up for objects with no references.

However, the clean-up depends on the reference and if a reference remains, the garbage collector will skip it. In effect, this will be the same as a memory leak. Finally, it will run out of free memory. So, though it may have better memory management, a programmer can’t provide to ignore cleaning-up.

Java cannot be embedded because it’s too big

It started with 20 class libraries and now Java 9 has more than 6000! These are critical support bases since Java cannot depend on a specific platform-based library. For Java developers, the libraries are especially handy since there is little need to take support of a third party. But it did make Java’s size very big. Full JRE took as much as 40MB of storage space.

But Java has addressed this issue actively in its last few versions. Java 8 introduced solid profiles, the smallest of which would need just 10 MB. Java 9 has created a modular format so that one can pick and choose what one wants, restraining the size.

Java is not secure

This idea gained traction when an idea was floated that an applet can easily access a hard drive. With this came scares of corruption and even erasures. But, in truth Java security is not that light. An applet cannot access the system with impunity. There are checks and balances to prevent this. A digitally signed applet will trigger warning systems in the OS, asking the user if they acknowledge it.

Conclusion

Java has been around long sufficient to develop its own mythology. From the sole language that can fix it all to its features and functionality, there are obviously many myths associated with Java. While some may have come from earlier versions, others are just not true.

HOW TO USE JENKINS WEB-BASED BUILD MANAGEMENT TOOL IN JAVA APPLICATIONS?

In this post, java application development experts will discuss Jenkins web-based build management tool and its requirement in developing projects. You can read this post and learn how to install Jenkins and make the best use of this management tool.

Introduction:

The necessity of building a tool is to integrate the source code properly which is developed by many people for a single project. Each developer works on different modules from the same code base, so frequently the code gets updated.

The build management tool’s responsibility is to take the latest version of code from the repository and produce the new version of Project.  The good feature of Jenkins is we can use any build tool and version control. For example, if you are using ANT based build tool, we can configure ANT in Jenkins for your project build process.

If your project is using a Maven-based build, you can configure Maven for your Project. Similarly, you can set up any version control which is available from Jenkins. You can use CVS, SVN, and GIT, etc.  So, The Jenkins is not live with one particular tool, based on the project requirement, we can customize the Jenkins.

I will be explaining the following things in this article.

  1. Jenkins installation steps.
  2. Creating Project in Jenkins
  3. Integrating the Maven build tool in Jenkins
  4. Building project using Jenkins.

Jenkins installation steps

Go to the following official website for Jenkins

https://jenkins.io/

Once you click the download button it will prompt the following window

Click LTS Release which is a stable one. You will be getting the installer file from the download. Double click on the installer and follow the steps to install. You will be seeing the following steps to install it successfully.

After successful installation following folder should create in your windows S.

<Your drive>:\Program Files (x86)\Jenkins

Following the path, you can see a Jenkins.war.

C:\Program Files (x86)\Jenkins

Copy Jenkins war file to your tomcat location of web app folder. Start the tomcat server by clicking the startup.bat file. After starting the server, you can see the Jenkins-related logs in the server console without error. It means Jenkins deployed in the server successfully.


In the web app folder, you can see the Jenkins folder which is extracted from Jenkins.war.

Use the following URL to get the Jenkins home page in your local.

http://localhost:8080/

This URL gives the home page of Jenkins as in the below screenshot.

Now, we have installed Jenkins in our system and it is running successfully.

Creating Project in Jenkins

Creating Project means you are creating a building management Project for your existing Java Project.

Click “create new jobs”. It will show the following screen.

Select maven project and enter the project name. Here I have entered it as “java-spring-maven” then click ok. Next it will ask you to enter project settings for “java-spring-maven” as in the screenshot.

Add some description about the project as in the screenshot.

Select source management as none because I have not used any source management.

Enter the pom.xml file path in the Root POM text field and enter the maven Goals as in the screenshot. The pom.xml file path should be from your java project folder. In this example, I am using the java-spring Project which is coming from “F:\Work\example-workspace\java-spring”. Create a simple maven-based project using eclipse and share that pom.xml file in the field as in the above screenshots.

If you want to get an email notification while building failure, select the “E-mail Notification” check box and enter a valid email as in the screenshot.

Once you enter all, click the Save button and the following screen will appear.

Till now we have integrated the maven build tool in Jenkins for a java based maven Project.

We have configured the maven build tool in our project and the next step is we need to add JDK and maven in Jenkins to run the build.

Click manage Jenkins, you will get the following screens.

Click Configuring system
Click Add JDK Button as in the screenshot

Once you click “Add JDK” the following section will appear.

Deselect install automatically checkbox. Once you have done that, the following section will appear.

Enter your Java version name in the JDK Name field and enter your java home in the JAVA_HOME field as in the screenshot.

Now we need to give maven information as follows. Click Add maven button as in the screenshot.

Once you click, the following section will appear.

Unselect the “install automatically” check box. You will get the following section.

In the Above section, you need to enter the maven name and maven home as in the screenshot below.

We have entered the JDK details and Maven details. Now click the save button. Once it is saved successfully following screen will appear.

The screen shows the Project details. Click on the project name. Once you click it, navigate to the following screen where it says about the Project information.

We have completed the build setup. Now, this is a time to build the application using Jenkins. Click the “Build Now” link in the side navigation bar as in the above screenshot. Once you click the “Build Now” link, your project build will start and shows a progress bar as in the below screenshot.

If the build is completed the progress bar will disappear. Now click the #1 link, it will show the build details as in the screenshot.

As per the above screenshot, we have completed one build successfully. If you want to see the build log click “Console Output” in the side navigation bar. It will show the build log as in the below two screenshots.

Click “Back to Project” from the side navigation bar.

Once you click, you will be navigated to the project home page as in the below screenshot

If you see highlighted red color box, it shows the build details such as build happened time and how the build went whether success or failure, etc. This is showing that our build is successful.

If you click “#1”, it will go to the following details page.

The ‘Module builds” showing as java-spring. It is our java project nameWhenI set the pom.xml path in the project settings, I have pointed out the pom.xml file which belongs to “java-spring” if don’t remember, go back and check the project settings in the document.

When clicking the “Java-spring” link, the following screen will appear. This shows generated war file for our deployment which is java-spring-0.0.1-SNAPSHOT.war

Hope this article will help you in making the best use of the Jenkins tool in java application development. If you did not understand anything, contact professionals and ask your doubts. You can leave your feedback for this post in your comments.

Related Article:

How To Protect Your Intellectual Property While Outsourcing Java Development Projects

Why Java Developers Need Java Messaging System?