Ben Chuanlong Du's Blog

It is never too late to learn.

Exceptions in Java

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. You can suppress warnings of unchecked exceptions by using

    SuppressWarnings("unchecked")
    

    but generally speaking, you cannot suppress warnings of checked exceptions.

  2. You can use more than one catch blocks if necessary …

Functions in Bash

By default, variables defined in a function are global, i.e., they are visible outside the function too.

Get Resources in Java

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. getResource and getResourceAsStream tries to find files in the resources directory under src/main/resources or src/test/resources (depending on whether you are running the application or tests for the …

A JNI Error Has Occured

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Error Messages

Error: A JNI error has occurred, please check your installation and try again

Caused by: java.lang.ClassNotFoundException: org.apache.spark.sql.SparkSession

Cause

Some dependencies (Spark in this …