The problem for that is having different jre versions
I have java 6 and 8 both installed in my system, so I uninstalled java 6 and set path for only java 8.
But remember to restart the system after setting the paths.
Now error is gone while viewing android L Preview