Alarm written in java