The USS Forrestal (CV 59) conducted trials in October 1963 using a Marine Corps KC-130F. The motivation for these tests, ordered by the Chief of Naval Operations, was to determine the feasibility of using the existing C-130 aircraft as a long-range carrier onboard delivery (COD) transport. At the time, the Navy was using the C-1 Trader for COD duties, but the plane was limited to a rather small payload and a 300 mile (480 km) range. When operating far out at sea, carriers were unable to receive desperately needed supplies without steaming closer in to shore. It was hoped that the larger, long-range C-130 would be able to address that deficiency. Initial flight testing began on 30 October when the C-130 made its first landing on the Forrestal into a 40-knot wind. Helping to guide the C-130 along the deck was a special dashed centerline, visible in the above image. Even with this line, however, the aircraft's wingtip cleared the carrier's island by less than 15 ft (4.6 m).
All told, the flight tests included 29 touch-and-go landings, 21 unarrested full-stop landings, and 21 unassisted takeoffs at gross weights ranging from 85,000 lb (38,555 kg) to 121,000 lb (54,885 kg). At the lower weight, the aircraft managed to come to a complete stop in only 267 ft (81 m), which is little more than double the plane's wingspan. Even at maximum weight, the C-130 required only 745 ft (227 m) for takeoff and 460 ft (140 m) for landing. Landings were made shorter by reversing the propellers while the aircraft was still a few feet above the flight deck. (h/t aerospaceweb.org)
The idea started in the late 1950s when the Central Intelligence Agency (CIA) was looking for a way to overcome the range limitations of the U-2. Possessing a useful range of about 3,000 miles (4,800 km), the U-2 simply could not reach every location of interest to the CIA given the locations of U-2 bases. As a result, the CIA began a cooperative effort with the US Navy known as Project Whale Tale. The purpose of this project was to adapt the U-2 for use aboard aircraft carriers. Testing commenced in August of 1963 when, in the dark of night, a crane lifted a U-2C onto the deck of the USS Kitty Hawk at San Diego, California. The vessel streamed off the coast on the morning of 5 August where Lockheed test pilot Bob Schumacher began flight test operations.
Since this initial testing looked promising, Lockheed and the Navy modified three U-2A airframes with stronger landing gear, an arresting hook, and wing spoilers to decrease the lift during landing. These new aircraft became known as the U-2G. Schumacher and several CIA pilots also became carrier-qualified by flying the T-2 Buckeye trainer and making practice landings aboard the USS Lexington. All was ready on 2 March 1964 when Schumacher made the first landing of a U-2G aboard the USS Ranger off the California coast. Although a series of touch-and-go approaches had gone well, the first landing was slightly less than successful when the arrestor hook engaged and forced the nose of the plane to dig into the deck. Despite breaking off the pitot tube, quick repairs allowed the aircraft to takeoff again. Successful takeoffs and landings continued a few days later, and the Navy considered five CIA pilots to be qualified to operate the U-2 aboard ship.
The first, and probably only, operational mission of the U-2G occurred in May 1964 when a plane operating off the USS Ranger monitored French nuclear tests at the Mururoa atoll. Otherwise, the capability to operate U-2s at sea did not appear to be in great demand. However, CIA pilots continued to be trained for carrier operations over the next few years. The program continued when the much larger U-2R was introduced in 1967. Even being some 40% bigger than the U-2A or U-2G and with twice the range as well as four times the payload, the CIA and Navy still saw advantages to operating the aircraft from a carrier. Modifications included adding an arrestor hook and a wing-folding mechanism to fold the outer six feet of each wing for improved handling aboard ship (note: above photos are the U-2R variant)
Then there was the V-2:
The Naval Mustang:
Oh yes, there were a group of naval aviators who did eventually fly the Mustang, and in combat no less. Just not off the ship. Read about VCS-8 and ops over southern France here.
(P.S. Don't bother with the C-17 landing on the CV -- it's a Photoshop...)