Can we create custom udf in Java and add that jar and use in Hive ?
Yes you can create your custom user defined function in Java and add to the Hive.
But you need to add all the dependencies and set the serde for it.
After that you need to do the following steps.
ADD JAR hdfs:///data/hive/json-serde-22.214.171.124-Hive13-jar-with-dependencies.jar;
All the best!