The man was shot at about 4 a.m. at O'Hara Park Middle School, located at 1100 O'Hara Ave., and pronounced dead at the scene, police said.
His identity had not been released today.
The Oakley Police Department and Contra Costa County Sheriff's Office are investigating the killing.
The crime scene had been processed this morning and investigators were conducting interviews, police said.
Anyone with information about the shooting is asked to call Oakley police dispatch at (925) 646-2441.