Java

Fix Java Won’t Update in OSX Sierra

I have an issue using Oracle JDK in my laptop that the auto updater successfully update the JDK but the update is not applied on my system. I check my java version using.

$ java -version

But still showing the old version rather than the latest one.
I fix my issue by putting this following line on my bash configuration.

export PATH="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin:$PATH"
Advertisements

Basic Reactive Programming with RxJava

Just found interesting blog post series about reactive programming with RxJava.

http://blog.danlew.net/2014/09/15/grokking-rxjava-part-1/
http://blog.danlew.net/2014/09/22/grokking-rxjava-part-2/
http://blog.danlew.net/2014/09/30/grokking-rxjava-part-3/
http://blog.danlew.net/2014/10/08/grokking-rxjava-part-4/

Thanks to Daniel Lew 😀

 

Parse ISO-8601 Date Format in Java

Here is code snippet to convert and parse String ISO-8601 formatted date using Joda-Time in Java.
In this case I have to parse it to more readable date time format.

String isoDate = "2015-09-03T12:32:45+0000";
DateTime dt = new DateTime(isoDate);
String newDate = dt.toString("d MMM YYYY, k:m"); // for more advanced pattern see http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
System.out.println(newDate); // 3 Sep 2015, 12:32

Reference: http://stackoverflow.com/a/20578792