airtrain to Jamaica station, take the subway to new york penn station (its near times square, i think thats lines A, C, E but i cant remember, then NJ transit (train also) to Newark airport, which is the next stop after newark penn. My guess is this will take 1.5 to hours depending on how you time the connections?
cab is way too expensive, and buses are tough if you dont know them. dont know about airport to airport shuttles...