Apple has become the latest big company to admit it has been a victim of computer hacking.
The multinational said there was no indication that any data had been taken and it was working with authorities to investigate the incident.
It comes just a week after social media giant Facebook revealed it had been the victim of a similar cyber attack.
Apple, based in California, said in a statement: "Apple has identified malware which infected a limited number of Mac systems through a vulnerability in the Java plug-in for browsers.
"The malware was employed in an attack against Apple and other companies, and was spread through a website for software developers. We identified a small number of systems within Apple that were infected and isolated them from our network.