Java on the Mac is a mess. Unfortunately, I depend on Java to run NetBeans, under which I do all Python development. I really should switch to another IDE but I’m used to NetBeans, despite the problems with version 7. When I do try other IDEs they feel small and under-featured.
Apple doesn’t support Java any more – that is, they gave up putting it as part of OS X by default. But old versions persist on your machine -do you see the messiness? – and I can’t persuade NetBeans to use the latest (1.7). It is more or less universally acknowledged the old Java versions can’t be uninstalled. I suppose that’s vertical integration for you. I googled around, found some very sane hints but, for example,
Matching Java Virtual Machines (2): 1.6.0_51-b11-457, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home 1.6.0_51-b11-457, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
This deficit of 1.7-ness explains why the response to “java -version” on the Terminal, and the one that NetBeans uses, is 1.6.
But not why on earth the System Java is 1.7 version 25 (according to Java Preferences)! Where is it hiding?
I tried to close everything that could be using Java and reinstall from the .dmg [it was the wrong installation – see below]
The conclusion, NetBeans is a world of pain on the mac. I need a real IDE. I’m looking at Wing IDE 5 Beta7 seems like a learning curve and I already see that Mercurial integration isn’t wonderful by any means – I can’t set default push and pull directories, which means unnecessary typing of paths.
A bit more googling, with more precise search terms (e.g. “usr/libexec/java_home -V doesnt’ show java 7”) – nice misplaced apostrophe there – got me to this page and this answer from Ian Roberts. It’s relatively simple: Installing Java, as in – “Get Java” and “Do I have Java?“*
You have the recommended Java installed (Version 7 Update 25).
doesn’t install Java the JVM. You are supposed to know that Java Java (JRE) is for web-browsers, and for people that don’t know what Java is. If you know what Java is, then Java won’t be enough for you, you need to install JDK, the Java Development Kit. You download that from here, after ignoring the following which is patent rubbish. I need the JDK to run NetBeans – the JRE is not enough:
Which Java package do I need?
- JDK: (Java Development Kit). For Java Developers. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications.
- Server JRE: (Server Java Runtime Environment) For deploying Java applications on servers. Includes tools for JVM monitoring and tools commonly required for server applications, but does not include browser integration (the Java plug-in), auto-update, nor an installer. Learn more
- JRE: (Java Runtime Environment). Covers most end-users needs. Contains everything required to run Java applications on your system.
To be honest, there is a clue on this page, which offers NetBeans and JDK 7 in a package. But that would work, of course, only for people that didn’t have NetBeans.
Absolute madness. All the same, I downloaded and installed JDK 7 Update 25 and now I see the following:
1.7.0_25, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home 1.6.0_51-b11-457, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home 1.6.0_51-b11-457, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home
NetBeans runs under Java 7, and can update. 3 hours of my life that I’ll never get back.
*No, you have gigantism.