We reach firmer ground in 1747, when James entered the service of the East India Company, and after two years as chief mate, was appointed to command the Guardian, a ship of war belonging to the Bombay marine, in which he was employed as senior officer of a small squadron protecting the country trade and operating against the pirate chief Angria. Success attended his efforts; his convoys passed safely; and in several encounters with Angria's ships they were repulsed with loss, and were at last driven to take shelter under the guns of Gheriah or Severndroog. James's energy and ability were recognised, and in 1751 he was promoted to be commodore and commander-in-chief of the company's marine forces, with a broad pennant on board the Protector of 44 guns.
The pirates still continued formidable. Angria had built some larger vessels, and boasted that he would be master of the Indian seas. The Mahrattas, equally with the company, felt him as a scourge, and in March 1755 a joint expedition against Severndroog was determined on, James being ordered to blockade, while the actual assault was given by the Mahrattas. James, however, soon found that his allies were either lukewarm or were overawed by Angria's prestige. He accordingly pushed his ships into the very harbour, between the forts, which were either blown up or surrendered after a sharp action lasting till midnight of 2 April. ‘In one day,’ wrote Orme, ‘the spirited resolution of Commodore James destroyed the timorous prejudices which had for twenty years been entertained of the impracticability of reducing any of Angria's fortified harbours’ (Military Transactions … in Hindostan, i. 406). When Severndroog had fallen, the squadron moved up to Bankot, which surrendered. The Mahrattas, now anxious to push their advantage, offered James two lacs of rupees to co-operate with them. But James had already exceeded his instructions, and refused to do more without permission from Bombay. This the governor and council would not give, judging the season too late; James was ordered back, and Severndroog, according to agreement, was handed over to the Mahrattas.
In November Rear-admiral Watson arrived at Bombay with a strong squadron of king's ships; he found there a body of troops, under Colonel Clive, newly come from England. It was resolved to take advantage of this happy meeting to put an end to Angria's power. But this was sheltered by the forts of Gheriah, which were said to be impregnable. James was sent with a small squadron to reconnoitre. He reported ‘that the place was not high, nor nearly so strong as had been represented.’ The expedition accordingly left Bombay on 7 Feb. 1756, appeared off Gheriah on the 11th, and successfully attacked the forts on the 13th. The loss of the squadron was very small, mainly owing to the skilful pilotage of James (Edinburgh Review, cxlviii. 367). Early in 1757, when the news of the French declaration of war reached Bombay, it became necessary to send it on to Watson, then in the Hooghly. The passage up the Bay of Bengal, against the north-east monsoon, was till then held to be impracticable, or, at best, excessively tedious. James, however, undertook to make it. It would seem that he had already studied the variations of the monsoons, and he now published his great discovery by running down to about 10° of south latitude, making the easting on that parallel, and so fetching Acheen, the north-west point of Sumatra, from which the course to the Hooghly is easy. James thus made the passage in an incredibly short time, and brought the important news to Watson and Clive.
In 1759, having amassed a considerable fortune, both by the Severndroog and Gheriah prize-money and by mercantile operations, James returned to England, purchased an estate near Eltham, a few miles from Blackheath, and married (if the early story be true, as his second wife) Anne, daughter of Edmond Goddard of Hartham in Wiltshire. Among his friends was the humourist Laurence Sterne, who was a frequent visitor at the James's town house in Gerrard Street, Soho. His wealth procured him a seat at the board of directors, of which he was at different times deputy-chairman and chairman. On 25 July 1778 he was created a baronet. He was member of parliament for West Looe in Cornwall, and elder brother and deputy-master of the Trinity House. He died of apoplexy on 16 Dec. 1783, in the midst of the festivities attending the marriage of his only daughter, Elizabeth Anne, to Thomas Boothby Parkyns, afterwards first Lord Rancliffe. He was succeeded by his son Edward William, who died at the age of eighteen, in 1792, when the title became extinct (Burke). It has been said that Edward William was the third baronet, and that James's immediate successor was a son, Richard, born in India of a native mother. That there was such a son is possible, but his legitimacy would be extremely doubtful. James's widow erected in 1784 a tower on the top of Shooter's Hill as a monument to her husband's memory. It is still known as Severndroog Tower, but at the time it appears to have been popularly called ‘Lady James's Folly.’ Lady James died 9 Aug. 1789.