Various software libraries and frameworks provide a variety of APIs to support secure coding. However, misusing these APIs can cost developers tremendous time and effort, introduce security vulnerabilities to software, and cause serious consequences like data leakage or Denial of Service (DoS) on servers. No prior tutorial educates people on the best practice of secure coding, the pitfalls that should be avoided, and the remediation of insecure code. To increase the security awareness of developers and improve the quality of their software products, we propose a 90-minute tutorial to teach participants the principles and practices of Java secure coding. In this tutorial, we will introduce the principles of using security APIs, analyze typical API misuse cases to explain the causes and effects. We will also introduce a tool that we recently developed to automatically detect API misuse in Java. There are five parts in our tutorial. To reveal the existing status of secure coding practice, we will first introduce the findings in our recent study on StackOverflow posts relevant to Java security. Second, we will discuss the recommended principles of API usage by security experts. Third, to correlate the principles with existing practice, we will also discuss some API misuse examples for the hash digest, message encryption and decryption, key generation, and SSL/TLS connection. Fourth, we will ask participants to examine extra code examples and discuss the security property of each example. Finally, We will give an overview of the available tools and resources, demonstrate a tool named RIGORITYJ that we recently developed to automatically detect API misuse in Java. We will also help participants install and use RIGORITYJ on their own machines and ask them for trials.