Retired Navy Capt. John L. Frazer Jr., 88, a Navy physician who was a veteran of both world wars, died Friday at his home in Elberon, N.J. He had pneumonia.

Capt. Frazer was a native of Fitzgerald, Ga. He was a graduate of Vanderbilt University and the University of Louisville's medical school. He received his Navy commission in 1917.

Before World War II, he served at Navy hospitals at Great Lakes Naval Station in Illinois, at the naval base at Key West, Fla., and at the submarine base at Pearl Harbor.

During the war, he helped set up a hospital in Iceland and served on a hospital ship in the Pacific.

His post-war aggisnments included the Bureau of Medical Personnel in Washington and the Navy Home in Philadelphia, from which he retired in 1957 and moved to Washington.

Capt. Frazer was treasurer of the Washington chapter of Military Order of World Wars and was an honorary Shriner. He moved to New Jersey in 1977 following the death of his wife of 50 years, the former Carolyn M. Barth, and lived with a daughter, Carolyn F. Lloyd.

In addition to Mrs. Lloyd of Elberon, survivors include two brothers and two grandchildren.