JavaFX Hello World Example

This article will show you how to create a simple "Hello World" application in JavaFX. Tested with Java 17 JavaFX 17.0.6 Maven 3 Table of Contents 1. Project Directory 2. Maven Dependencies 3. JavaFX Hello World 4. Run JavaFX Hello World with Maven 5. Run JavaFX Hello World with Maven and IntelliJ IDEA 6. Download …

Read more

Java Swing Hello World example

The below program launch a Java Swing application; It configures a JFrame and attach a JLabel to display a hello world and center the JLabel component. Read the comment for self-explanatory. SwingHelloWorld.java package com.mkyong.swing import javax.swing.*; import java.awt.*; public class SwingHelloWorld { public static void main(String[] args) { JFrame frame = new JFrame("Hello World Java …

Read more

Gradle + Quarkus Hello World example

This article shows how to create or scaffold a Gradle + Quarkus JAX-RS hello world project, which creates a /hello endpoint and returns a string. Technologies used: Quarkus 1.11.0 Gradle 6.7 Maven 3.6.3 Java 11 Topics Creating a new Gradle + Quartus project Gradle + Quarkus Project Structure Quarkus and build.gradle Quarkus Dependencies (runtimeClasspath) Quarkus …

Read more

Maven + Quarkus Hello World example

This article shows how to use the quarkus-maven-plugin to create or scaffold a Maven + Quarkus JAX-RS hello world project. Technologies used: Quarkus 1.11.0 Maven 3.6.3 Java 11 Topics Creating a new Maven + Quartus project Maven + Quarkus Project Structure Quarkus and pom.xml Quarkus Dependencies Quarkus JAX-RX endpoint Quarkus and Dockerfile Run Quarkus in …

Read more

Spring Boot Hello World Example – Mustache

A Spring Boot web application example, using embedded Tomcat + Mustache template engine, and package as an executable JAR file. Technologies used : Spring Boot 1.5.2.RELEASE Spring 4.3.7.RELEASE jmustache 1.13 Thymeleaf 2.1.5.RELEASE Tomcat Embed 8.5.11 Maven 3 Java 8 Note Spring Boot uses jmustache to integrate Mustache as template engine. 1. Project Directory 2. Project …

Read more

Apache Solr Hello World Example

Apache Solr is an Open-source REST-API based Enterprise Real-time Search and Analytics Engine Server from Apache Software Foundation. It’s core Search Functionality is built using Apache Lucene Framework and added with some extra and useful features. It is written in Java Language. SOLR stands for Searching On Lucene w/Replication. It’s main functionalities are indexing and …

Read more

ElasticSearch Hello World Example

ElasticSearch is an Open-source Enterprise REST based Real-time Search and Analytics Engine. It’s core Search Functionality is built using Apache Lucene, but supports many other features. It is written in Java Language. It supports Store, Index, Search and Analyze Data in Real-time. Like MongoDB, ElasticSearch is also a Document-based NoSQL Data Store. Note ElasticSearch website: …

Read more

Spring Boot Hello World Example – Thymeleaf

In this article, we will show you how to develop a Spring Boot web application, using Thymeleaf view, embedded Tomcat and package it as an executable JAR file. Technologies used : Spring Boot 2.1.2.RELEASE Spring 5.1.4.RELEASE Thymeleaf 3.0.11.RELEASE Tomcat embed 9.0.14 JUnit 4.12 Maven 3 Java 8 1. Project Directory 2. Maven Put spring-boot-starter-web and …

Read more

Spring Boot Hello World Example – JSP

A Spring Boot web application example, using embedded Tomcat + JSP template, and package as an executable WAR file. Technologies used : Spring Boot 1.4.2.RELEASE Spring 4.3.4.RELEASE Tomcat Embed 8.5.6 Maven 3 Java 8 1. Project Directory Create the following folders manually : 2. Project Dependencies Maven example. Read comments for self-explanatory. pom.xml <?xml version="1.0" …

Read more

Meteor hello world example

In this tutorial, we will show you how to create a website with Meteor framework. Tools used : Meteor 1.2.1 Tested with Linux (Debian, Ubuntu or Mint) Tested with Mac OSX 1. Install Meteor Issue curl https://install.meteor.com | sh, everything will be installed and configured. $ curl https://install.meteor.com | sh % Total % Received % …

Read more

Ant – Spring MVC and WAR file Example

In this tutorial, we will show you how to use Ant build script to manage a Spring MVC web application project, create a WAR file and deploy to Tomcat. Technologies used : Eclipse 4.2 JDK 1.7 Ant 1.9.4 Ant-Ivy 2.4 logback 1.1.2 jstl 1.2 Spring 4.1.3.RELEASE Tomcat 7 1. Project Directory Review the final project …

Read more

Spring MVC hello world example (Gradle and JSP)

This tutorial shows you how to create a Spring Web MVC application with the Jakarta Server Pages (JSP; formerly JavaServer Pages) template. Technologies and tools used: Java 11 Spring 5.2.22.RELEASE JSP JSTL 1.2 Servlet API 4.0.1 Bootstrap 5.2.0 (webjars) IntelliJ IDEA Gradle 7.5.1 Gradle Gretty plugin 3.0.9 for embedded servlet containers (Tomcat 9 and Jetty …

Read more

Log4j hello world example

In this tutorial, we will show you how to use the classic log4j 1.2.x to log a debug or error message in a Java application. 1. Project Directory Review the final project structure, a standard Maven style Java project. 2. Get Log4j Declares the following dependencies : pom.xml <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> For non-Maven …

Read more

Spring Security Hello World Annotation Example

In preview post, we are using XML files to configure the Spring Security in a Spring MVC environment. In this tutorial, we are going to show you how to convert the previous XML-base Spring Security project into a pure Spring annotation project. Technologies used : Spring 3.2.8.RELEASE Spring Security 3.2.3.RELEASE Eclipse 4.2 JDK 1.6 Maven …

Read more

TestNG Hello World Example

A classic example, show you how to get started with TestNG unit test framework. Tools used : TestNG 6.8.7 Maven 3 Eclipse IDE 1. TestNG Dependency Add TestNG library in the pom.xml. pom.xml <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.8.7</version> <scope>test</scope> </dependency> 2. TestNG Example Review a simple class, has a method to return a fixed email “[email protected]”. …

Read more

Spring Batch Hello World Example

Spring Batch is a framework for batch processing – execution of a series of jobs. In Spring Batch, A job consists of many steps and each step consists of a READ-PROCESS-WRITE task or single operation task (tasklet). For “READ-PROCESS-WRITE” process, it means “read” data from the resources (csv, xml or database), “process” it and “write” …

Read more

MongoDB hello world example

A quick guide to show you how to do basic operations like create, update, find, delete record and indexing in MongoDB. This example is using MongoDB 2.0.7, running on Mac OS X 10.8, both MongoDB client and server console are run on localhost, same machine. 1. Install MongoDB Install MongoDB on Windows, Ubuntu or Mac …

Read more

PrimeFaces hello world example

In this tutorial, we will show you how to create a JSF 2 + PrimeFaces wed project, the final output is display a “hello world” string in PrimeFaces editor component. Tools used : JSF 2.1.11 Primefaces 3.3 Eclipse 4.2 Maven 3 Tested on Tomcat 7 Note PrimeFaces only requires a JAVA 5+ runtime and a …

Read more

Android hello world example

In this tutorial, we show you how to create a simple “hello world” Android project in Eclipse IDE + ADT plugin, and run it with Android Virtual Device (AVD). The Eclipse ADT plugin provided easy Android project creation and management, components drag and drop, auto-complete and many useful features to speed up your Android development …

Read more

Google Maps API hello world example

A simple hello world guide to display Google Maps on a web page, via Google Maps Javascript API v3. In this tutorial, we show you how to display a map centered on “Malim Nawar, Malaysia” (my hometown), and use “marker (small icon)” to identify the location on the map. Full example… <html> <head> <title>Google Map …

Read more

Spring Security hello world example

In this tutorial, we will show you how to integrate Spring Security with a Spring MVC web application to secure a URL access. After implementing Spring Security, to access the content of an “admin” page, users need to key in the correct “username” and “password”. Technologies used : Spring 3.2.8.RELEASE Spring Security 3.2.3.RELEASE Eclipse 4.2 …

Read more

JAXB hello world example

Jakarta XML Binding (JAXB; formerly Java Architecture for XML Binding) is an XML binding framework to convert Java objects to and from XML. XML Marshalling – Convert Java objects into XML. XML Unmarshalling – Convert XML back into Java Objects. Note This article will focus on Java 11, JAXB 3 and EclipseLink MOXy JAXB RI. …

Read more

Spring 3 REST hello world example

In Spring 3, old RequestMapping class is enhanced to support RESTful features, which makes Spring developers easier to develop REST services in Spring MVC. In this tutorial, we show you how to use Spring 3 MVC annotations to develop a RESTful style web application. 1. Project Directory Review the project folder structure. 2. Project Dependency …

Read more

Jersey hello world example

This article shows how to start a Grizzly HTTP server to run a JAX-RS or Eclipse Jersey application. Tested with Jersey 3.0.2 Grizzly 3 HTTP server Java 8 Maven JUnit 5 Table of contents 1. Project Directory 2. Jersey dependencies 3. Jersey and HK2 dependency injection 4. Jersey endpoints 5. Start Jersey application 6. Demo …

Read more

RESTEasy hello world example

RESTEasy, JBoss project, implementation of the JAX-RS specification. In this tutorial, we show you how to use RESTEasy framework to create a simple REST style web application. Technologies and Tools used in this article: RESTEasy 2.2.1.GA JDK 1.6 Maven 3.0.3 Eclipse 3.6 What’s REST? Read this, this and this to understand what’s REST. 1. Directory …

Read more

Spring EL hello world example

The Spring EL is similar with OGNL and JSF EL, and evaluated or executed during the bean creation time. In addition, all Spring expressions are available via XML or annotation. In this tutorial, we show you how to use Spring Expression Language(SpEL), to inject String, integer and bean into property, both in XML and annotation. …

Read more

Spring 3 hello world example

This tutorial shows you how to create a simple hello world example in Spring 3.0. Technologies used in this article : Spring 3.0.5.RELEASE Maven 3.0.3 Eclipse 3.6 JDK 1.6.0.13 P.S Spring 3.0, at least JDK 1.5 is required to work. Spring 3.0 dependencies In Spring 2.5.x, almost the entire Spring modules are grouped into a …

Read more

Spring Data MongoDB hello world example

In this tutorial, we show you how to use “SpringData for MongoDB” framework, to perform CRUD operations in MongoDB, via Spring’s annotation and XML schema. Updated on 1/04/2013 Article is updated to use latest SpringData v 1.2.0.RELEASE, it was v1.0.0.M2. Tools and technologies used : Spring Data MongoDB – 1.2.0.RELEASE Spring Core – 3.2.2.RELEASE Java …

Read more

Oracle Stored Procedures Hello World Examples

List of quick examples to create stored procedures (IN, OUT, IN OUT and Cursor parameter) in Oracle database. PL/SQL code is self-explanatory. 1. Hello World A stored procedure to print out a “Hello World” via DBMS_OUTPUT. CREATE OR REPLACE PROCEDURE procPrintHelloWorld IS BEGIN DBMS_OUTPUT.PUT_LINE(‘Hello World!’); END; / Run it exec procPrintHelloWorld; Output Hello World! 2. …

Read more

JSF 2.0 + Ajax hello world example

In JSF 2.0, coding Ajax is just like coding a normal HTML tag, it’s extremely easy. In this tutorial, you will restructure the last JSF 2.0 hello world example, so that, when the button is clicked, it will make an Ajax request instead of submitting the whole form. 1. JSF 2.0 Page A JSF 2.0 …

Read more

JSF 2.0 hello world example

In this tutorial, we will show you how to develop a JavaServer Faces (JSF) 2.0 hello world example, shows list of JSF 2.0 dependencies, basic annotations and configurations. Project Environment This JSF 2.0 example is built with following tools and technologies JSF 2.1.7 Maven 3 Eclipse 3.6 JDK 1.6 Tomcat 6.0.26 First, review the final …

Read more