Try this
public static long Hextonumber(String hexval)
{
hexval="0x"+hexval;
// String decimal="0x00000bb9";
Long number = Long.decode(hexval);
//....... System.out.println("String [" + hexval + "] = " + number);
return number;
//3001
}