Java Tutorials

Java Tutorials



Core Java Tutorials

Lucene
An Introduction to Apache Lucene for Full-Text Search
Did you mean feature with Apache Lucene Spell-Checker

Eclipse
Debugging a Production Server - Eclipse and JBoss showcase
Eclipse: How attach Java source
Eclipse Memory Analyzer (MAT)
Eclipse Code Formatting Tips

IntelliJ IDEA
What’s Cool In IntelliJIDEA Part I
What’s Cool In IntelliJIDEA. Part II: Live Templates
What’s Cool In IntelliJIDEA. Part III: External Tools

DateFormat
Java Best Practices – DateFormat in a Multithreading Environment

Google Guava
Google Guava Libraries Essentials

Generics
Java Generics Quick Tutorial

Regular Expressions
Regular Expressions in Java - Soft Introduction

Algorithms
The simple Big-O Notation Post

Collections
Java Best Practices – Vector vs ArrayList vs HashSet
Java Best Practices – Queue battle and the Linked ConcurrentHashMap
How to Avoid ConcurrentModificationException when using an Iterator
Using a memory mapped file for a huge matrix

Serialization
Java Best Practices – High performance Serialization
Cloning of Serializable and Non-Serializable Java Objects

Strings
Java Best Practices – String performance and Exact String Matching
Do it short but do it right !

IO
Java Best Practices – Char to Byte and Byte to Char conversions
Manipulating Files in Java 7
Java 7: Copy and Move Files and Directories

Enums
Java Secret: Using an enum to build a State machine

DI
Dependency Injection - The manual way

Preferences/Properties
Use java.util.prefs.Preferences instead of java.util.Properties
Configure Java EE applications or "Putting Bien into practice"

Concurrency
Java Fork/Join for Parallel Programming
The Exchanger and GC-less Java
Java Concurrency Tutorial – Semaphores
Java Concurrency Tutorial – Reentrant Locks
Java Concurrency Tutorial – Thread Pools
Java Concurrency Tutorial – Callable, Future
Java Concurrency Tutorial – Blocking Queues
Java Concurrency Tutorial – CountDownLatch
Concurrency optimization - Reduce lock granularity
Using a ThreadPoolExecutor to Parallelize Independent Single-Threaded Tasks
Java 7: How to write really fast Java code

Compression
Java Compression

Encryption
Java Pretty Good Privacy (PGP)

Garbage Collection
Low GC in Java: Use primitives instead of wrappers
Practical Garbage Collection, part 1 - Introduction

Reflection/Invocation
A glimpse at Java 7 MethodHandle and its usage
Java 7: A complete invokedynamic example

Try Clause
Java 7: try-with-resources explained
GC with Automatic Resource Management in Java 7
Java 7: Project Coin in code examples

Doubles
Double your money again

Naming
Java Naming Conventions

Design patterns
The Perfect Singleton
Using the State pattern in a Domain Driven Design
The Wizard Design Pattern
GWT MVP made simple

JAXB
Using JAXB to generate XML from XSD
Reusing Generated JAXB Classes
JAXB, SAX, DOM Performance
Make your JAXB cleaner with the MOXy implementation
XML parsing using SaxParser with complete code

Tools/Utilities
Using FindBugs to produce substantially less buggy code
Doclava: Custom Javadoc Doclet from Google
Code coverage with unit & integration tests

PowerMock
Testing an Object's Internal State with PowerMock
Mock Static Methods with PowerMock

JSON
Java JSON processing with Jackson

JUnit
Rules in JUnit 4.9 (beta 3)
Java RESTful API integration testing
Testing Techniques - Not Writing Tests
The Misuse of End To End Tests - Testing Techniques 2
What Should you Unit Test? - Testing Techniques 3
Regular Unit Tests and Stubs - Testing Techniques 4
Unit Testing Using Mocks - Testing Techniques 5
Creating Stubs for Legacy Code - Testing Techniques 6
More on Creating Stubs for Legacy Code - Testing Techniques 7
Why You Should Write Unit Tests - Testing Techniques 8
Some Definitions - Testing Techniques 9
DB unit testing with dbUnit, JSON, HSQLDB and JUnit Rules

Google APIs
Google ClientLogin Utility in Java

GPGPU
GPGPU Java Programming
GPGPU with Jcuda the Good, the Bad and … the Ugly

Twitter4J
Java Twitter client with Twitter4j

JavaMail
Sending emails with Java

SQL
Arcane magic with the SQL:2003 MERGE statement

Profiling
Profile your applications with Java VisualVM

References
Understanding Java Weak References


Enterprise Java Tutorials

Spring
JBoss 4.2.x Spring 3 JPA Hibernate Tutorial
Spring 3 HornetQ 2.1 Integration Tutorial
Spring 3 RESTful Web Services
Aspect Oriented Programming with Spring AspectJ and Maven
Sending e-mails in Java with Spring – GMail SMTP server example
JAX–WS with Spring and Maven Tutorial
Securing GWT apps with Spring Security
RESTful Web Services with RESTeasy JAX-RS on Tomcat 7 – Eclipse and Maven project
Exposing a POJO as a JMX MBean with Spring
Spring MVC Development - Quick Tutorial
Spring 3.1 Cache Abstraction Tutorial
Spring, Quartz and JavaMail Integration Tutorial
SpringMVC 3 Tiles 2.2.2 Integration Tutorial
jqGrid, REST, AJAX and Spring MVC Integration
Integrating Jersey with Spring
Spring Declarative Transactions Example
Swapping out Spring Bean Configuration at Runtime
Spring & Quartz Integration with Custom Annotation
Spring MVC Interceptors Example
Spring 3 Testing with JUnit 4 - ContextConfiguration and AbstractTransactionalJUnit4SpringContextTests
Spring & Quartz Integration with Custom Annotation, the SPANN way
Bootstrapping a web application with Spring 3.1 and Java based Configuration, part 1
Building a RESTful Web Service with Spring 3.1 and Java based Configuration, part 2
Securing a RESTful Web Service with Spring Security 3.1, part 3
RESTful Web Service Discoverability, part 4
REST Service Discoverability with Spring, part 5
Basic and Digest authentication for a RESTful Service with Spring Security 3.1, part 6
The persistence layer with Spring 3.1 and Hibernate
Simplifying the Data Access Layer with Spring and Java Generics
The Persistence Layer with Spring 3.1 and JPA
The Persistence Layer with Spring Data JPA
Transaction configuration with JPA and Spring 3.1
Configure LogBack Logging with Spring
Spring GWT Integration using the RequestFactory API
Develop Restful web services using Spring MVC
Spring MVC and REST at Google App Engine
Domain modeling with Spring Data Neo4j
Enabling JMX in Hibernate, EhCache, Quartz, DBCP and Spring
REST Pagination in Spring
Integration testing scoped beans in CDI 1.0 and Spring 3.1
Spring 3, Spring Web Services 2 & LDAP Security
Automatically generating WADL in Spring MVC REST application
OAuth with Spring Security
Properties with Spring

Java EE6
Java EE6 Decorators: Decorating classes at injection time
Java EE6 Events: A lightweight alternative to JMS
Java EE6 CDI, Named Components and Qualifiers
From Spring to Java EE 6
Red Hat Openshift: Getting started - Java EE6 in the Cloud
Configure Java EE applications or "Putting Bien into practice"
OpenShift Express: Deploy a Java EE application (with AS7 support)
Simulating CDI's Session and Request Scope in a J2SE app

Google Guice
Rich Domain Model with Guice

Grails
Build Twitter with Grails in 90 Minutes: The Gist of it

Log4J
Log4j, Stat4j, SMTPAppender Integration - Aggregating Error Logs to Send Email When Too Many

AOP
Aspect Oriented Programming with Spring AOP
Domain Driven Design with Spring and AspectJ
Practical Introduction into Code Injection with AspectJ, Javassist, and Java Proxy

OSGi - JBoss Modules
OSGi Using Maven with Equinox
JBoss Modules Example - Modular Web Application
OSGi – Simple Hello World with services
OSGI and Spring Dynamic Modules – Simple Hello World
OSGi: An Introduction
Introduction to OSGi - Modular Java

Hibernate
Hibernate mapped collections performance problems
DataNucleus 3.0 vs Hibernate 3.5
Spring MVC3 Hibernate CRUD Sample Application
Hibernate by Example - Part 1 (Orphan removal)
Hibernate by Example - Part 2 (DetachedCriteria)
Hibernate cache levels tutorial

JPA
Java Persistence API: a quick intro…
High performance JPA with GlassFish and Coherence - Part 1
High Performance JPA with GlassFish and Coherence - Part 2
High Performance JPA with GlassFish and Coherence - Part 3

Arquillian
Arquillian with NetBeans, GlassFish embedded, JPA and a MySQL Datasource
Arquillian with NetBeans, WebLogic 12c, JPA and a MySQL Datasource

Distributed Computing/Big Data
Cajo, the easiest way to accomplish distributed computing in Java
MapReduce: A Soft Introduction
Hadoop: A Soft Introduction
Hadoop Modes Explained - Standalone, Pseudo Distributed, Distributed
Big Data analytics with Hive and iReport

GWT
GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial
GWT Spring and Hibernate enter the world of Data Grids
Adding CAPTCHA to your GWT application
GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial – Eclipse and Maven 2 showcase
Add JSON capabilities into your GWT application

SmartGWT
Getting Started with SmartGWT for awesome GWT interfaces
Advanced SmartGWT Tutorial, Part 1
Advanced SmartGWT Tutorial, Part 2

Play! Framework
RabbitMQ Module for Play! Framework
Simple Twitter: Play Framework, AJAX, CRUD on Heroku
Play framework modules: Divide and conquer

Maven
Building your own GWT Spring Maven Archetype

Web Services
Web Services in Ruby, Python and Java

REST Services
Simplifying RESTful Search
WADL in Java: Gentle introduction

EJB
GWT EJB3 Maven JBoss 5.1 integration tutorial
An Introduction to EJB 3.0 Injection and Lookup
Basic EJB References, Injection and Lookup
EJB Programmatic Lookup
EJB 3.1 Global JNDI Access
References to EJBs Outside Your Application With Oracle WebLogic

Tomcat
Zero-downtime Deployment (and Rollback) in Tomcat; a walkthrough and a checklist
Multiple Tomcat Instances on Single Machine
Launching and Debugging Tomcat from Eclipse without complex plugins

Servlets/JSPs
Servlet 3.0 Async Processing for Tenfold Increase in Server Throughput
Hacking Jasper to Get Object Model of a JSP Page

JBoss
Hello World' portlet on JBoss Portal
JBoss AS 7 EJB3 Pools Configuration

Google App Engine
Google App Engine Java Capabilities and Namespaces API
App Engine Java Development with Netbeans
Google App Engine: Host application in your own domain
Android App Engine Integration

Apache CXF
Apache CXF Load Balancing And Failover
Web-service learnings with Apache CXF

Security
Apache Shiro : Application Security Made Easy

MongoDB
Using MongoDB with Morphia
Morphia and MongoDB: Evolving Document Structures
MongoDB with Spring Data project
Storing hierarchical data in MongoDB

JSF
Parametrizing custom validator in JSF 2
JSF and the "immediate" Attribute - Command Components

MyBatis
Configuring MyBatis 3

Vaadin
Vaadin add-ons and Maven
EJB Lookup in a Vaadin Application
Embedded Jetty, Vaadin and Weld

Git
Git DVCS - Getting started
My walk through the Git book

Akka
Even simpler scalability with Akka through RegistryActor

Groovy
Using Groovy - A soft introduction


Desktop Java Tutorials

General
Getting Started with YouTube Java API

Swing
Sometimes in Java, One Layout Manager Is Not Enough
Graphics Tutorial

Xuggler
RTMP To RTSP re-stream using wowza and xuggler
Introduction to Xuggler for Video Manipulation
Xuggler Tutorial: Transcoding and Media Modification
Xuggler Tutorial: Frames Capture and Video Creation

JavaFX
JavaFX 2.0 beta sample application and after thoughts
Integrating JavaFX 2.0 with Swing and SWT
PopupMenu in JavaFX 2


Android Tutorials


Core Android Tutorials

Install Android OS on your PC with VirtualBox
Android Location Based Services Application – GPS location
Android Reverse Geocoding with Yahoo API – PlaceFinder
Android Text-To-Speech Application
Android Full App, Part 1: Main Activity UI
Android Full App, Part 2: Using the HTTP API
Android Full App, Part 3: Parsing the XML response
Android Full App, Part 4: Performing the API request asynchronously from the main activity
Android Full App, Part 5: Launching new activities with intents
Android Full App, Part 6: Customized list view for data presentation
Boost your Android XML parsing with XML Pull
Android Full App, Part 7: Using options menus and customized dialogs for user interaction
Android Full App, Part 8: Creating an AppWidget for the home screen
Android Proximity Alerts Tutorial
Android Quick Preferences Tutorial
Android JSON Parsing with Gson Tutorial
Android Animations – Quick Guide
Android XML Binding with Simple Framework Tutorial
Android Google Maps Tutorial
Android HTTP Camera Live Preview Tutorial
Android: Menu Class Investigation
Android Dependency Injection and Testing Libraries
Android: Gallery View without Pictures
Android Drag and Drop Tutorial
Learning Android: Getting a service to communicate with an activity
Learning Android: Freezing the UI with a BroadcastReceiver


Android Game Tutorials

Android Game Development - The Game Idea
Android Game Development - Create The Project
Android Game Development - A Basic Game Architecture
Android Game Development - A Basic Game Loop
Android Game Development - Displaying Images with Android
Android Game Development - Moving Images on Screen
Android Game Development - The Game Loop
Android Game Development - Measuring FPS
Android Game Development - Sprite Animation
Android Game Development - Particle Explosion
Android Game Development - Design In-game Entities - The Strategy Pattern
Android Game Development - Using Bitmap Fonts
Android Game Development - Switching from Canvas to OpenGL ES
Android Game Development – Displaying Graphical Elements (Primitives) with OpenGL ES
Android Game Development – OpenGL Texture Mapping
Android Game Development – Design In-game Entities – The State Pattern


Scala Tutorials


Core Scala

Fun with function composition in Scala
Scala Tutorial - Scala REPL, expressions, variables, basic types, simple functions, saving and running programs, comments
Scala Tutorial - Tuples, Lists, methods on Lists and Strings
Scala Tutorial - conditional execution with if-else blocks and matching
Scala Tutorial - iteration, for expressions, yield, map, filter, count
Scala Tutorial - regular expressions, matching
Scala Tutorial - regular expressions, matching and substitutions with the scala.util.matching API
Scala Tutorial - Maps, Sets, groupBy, Options, flatten, flatMap
Scala Tutorial - scala.io.Source, accessing files, flatMap, mutable Maps
Scala Tutorial - objects, classes, inheritance, traits, Lists with multiple related types, apply
Scala Tutorial - scripting, compiling, main methods, return values of functions
Scala Tutorial - SBT, scalabha, packages, build systems
Scala Tutorial - code blocks, coding style, closures, scala documentation project
DI in Scala: Cake Pattern pros & cons
First steps with Scala, say goodbye to bash scripts…
Scala: Working with Predicates


Communications Tutorials


Kannel

Java API for Kannel SMS/WAP gateway
Java API for Kannel SMS/WAP gateway v 1.0.2 released


OpenFire/Smack

Openfire server installation - Infrastructure for Instant Messaging
Openfire server configuration - Infrastructure for Instant Messaging
XMPP IM with Smack for Java applications - Infrastructure for Instant Messaging