Apple retarded with Java and default packages
Apple does many things very well, but their handling of Java makes me obsolutely furious.
BTW, I'm running Tiger.
The GUI utility that came with JDK 1.5 that was supposed to switch the entire development environment to 1.5. It doesn't apply to the command line environment. The only way that I know of to do this is to change the shortcut in /System/Library/Frameworks/JavaVM.Framework/Versions/CurrentJDK to point to 1.5 instead of 1.4. When I tried to do this, I accidentally deleted the 1.4.2 directory.
I tried reinstalling XCode from the CD, which didn't include the 1.4 JDK package. I tried searching the Apple downloads and the Apple Developer site for a 1.4 package install, to no avail.
Now it looks like I'll have to reinstall Tiger to get it back.
This is absolutely retarded on the part of Apple. Every Linux distro that I know of includes some sort of package file for every package that's part of the base installation. Apple does not. Nor do they include a package repair utility. Nor do they include a package update system. Instead, they opt for Windows-style OS-wide updates, which is absolutely the wrong way to go.
They should also get the Java command-line environment straight, and release new JDKs sooner, and not require me to update my entire OS (Panther to Tiger) just to get to run them. Java development on OS X is simply not nearly as intuitive as it should be.
I shouldn't have the reinstall the entire OS because I accidently deleted a directly.
(I plan to tell Apple about this in a SLIGHTLY more diplomatic way
)
This is ludicrous, to say the least!
BTW, I'm running Tiger.
The GUI utility that came with JDK 1.5 that was supposed to switch the entire development environment to 1.5. It doesn't apply to the command line environment. The only way that I know of to do this is to change the shortcut in /System/Library/Frameworks/JavaVM.Framework/Versions/CurrentJDK to point to 1.5 instead of 1.4. When I tried to do this, I accidentally deleted the 1.4.2 directory.
I tried reinstalling XCode from the CD, which didn't include the 1.4 JDK package. I tried searching the Apple downloads and the Apple Developer site for a 1.4 package install, to no avail.
Now it looks like I'll have to reinstall Tiger to get it back.
This is absolutely retarded on the part of Apple. Every Linux distro that I know of includes some sort of package file for every package that's part of the base installation. Apple does not. Nor do they include a package repair utility. Nor do they include a package update system. Instead, they opt for Windows-style OS-wide updates, which is absolutely the wrong way to go.
They should also get the Java command-line environment straight, and release new JDKs sooner, and not require me to update my entire OS (Panther to Tiger) just to get to run them. Java development on OS X is simply not nearly as intuitive as it should be.
I shouldn't have the reinstall the entire OS because I accidently deleted a directly.
(I plan to tell Apple about this in a SLIGHTLY more diplomatic way

This is ludicrous, to say the least!
Comments
Is that not what you're looking for? I found it on Google. Search terms: apple reinstall java
They should also get the Java command-line environment straight,
What's crooked about OS X's Java command line environment? What OS has a better one and what makes it better? I used to be opposed to IDEs on a deep, nearly religious level (actually, I just didn't like all those project files cluttering up my source directories) so I did all my development from the command line. Windows, Linux, FreeBSD, OS X... none of them make it easy to switch between VMs. There's never a magic "java-use-vm /path/to/vm" utility. It always involves mucking around with the PATH and JAVA_HOME variables.
and release new JDKs sooner,
This is a beef of mine too. I forgive Apple because Swing doesn't look like ass on OS X the way it does on other platforms. They go to pretty great lengths to integrate Java and Cocoa and I guess it takes a little longer for them to do.
and not require me to update my entire OS (Panther to Tiger) just to get to run them.
I agree with you here too. Yeah, it's nice that Apple used some Tiger-only features in 1.5... for Tiger users. There should be a 1.5 JDK for everyone who doesn't want to upgrade though.
Java development on OS X is simply not nearly as intuitive as it should be.
What's counter-intuitive about it? What OS does it more intuitively and how do they do it? Java development tools are virtually the same across all platforms. They're written in frickin' Java. That's the point.
I shouldn't have the reinstall the entire OS because I accidently deleted a directly.
I agree. I'm also 99% sure that you don't (but not 100% so feel free to make me look dumb).
Originally posted by JavaCowboy
I tried reinstalling XCode from the CD, which didn't include the 1.4 JDK package. I tried searching the Apple downloads and the Apple Developer site for a 1.4 package install, to no avail.
Now it looks like I'll have to reinstall Tiger to get it back.
This is absolutely retarded on the part of Apple. Every Linux distro that I know of includes some sort of package file for every package that's part of the base installation. Apple does not. Nor do they include a package repair utility. Nor do they include a package update system. Instead, they opt for Windows-style OS-wide updates, which is absolutely the wrong way to go.
I see. You can always try Pacifist to extract package content from the Tiger CD/DVD, and not only. A great utility.
Originally posted by elron
http://www.apple.com/downloads/macos...update142.html
Is that not what you're looking for? I found it on Google. Search terms: apple reinstall java
No, that's not what I'm looking for. As I said in my first post, I tried to run the update pkg file, and it complained that no version of Java was available to do an update on. I want the original installer.
What's crooked about OS X's Java command line environment? What OS has a better one and what makes it better? I used to be opposed to IDEs on a deep, nearly religious level (actually, I just didn't like all those project files cluttering up my source directories) so I did all my development from the command line. Windows, Linux, FreeBSD, OS X... none of them make it easy to switch between VMs. There's never a magic "java-use-vm /path/to/vm" utility. It always involves mucking around with the PATH and JAVA_HOME variables.
Good God! Even Windows is easier for this! All I need to do is set $JAVA_HOME to the directory where my JDK is. Once $JAVA_HOME is set, the JDK is pointing to the right place. It really should be that simple.
Why the %#@! should I have to manually change a symlink (deleting then recreating it) to get this to work?
If you want to see an OS with an AWESOME Java config setup, check out Gentoo:
http://www.gentoo.org/doc/en/java.xml
This is a beef of mine too. I forgive Apple because Swing doesn't look like ass on OS X the way it does on other platforms. They go to pretty great lengths to integrate Java and Cocoa and I guess it takes a little longer for them to do.
I agree with you here too. Yeah, it's nice that Apple used some Tiger-only features in 1.5... for Tiger users. There should be a 1.5 JDK for everyone who doesn't want to upgrade though.
What's counter-intuitive about it? What OS does it more intuitively and how do they do it? Java development tools are virtually the same across all platforms. They're written in frickin' Java. That's the point.
Uh, the tool pretends to work when it doesn't? When I use a tool that tells me it's setting the default JDK, I expect it to actually SET the default JDK. Are you saying that I'm expecting too much for a tool that claims to do something to actually do it?
I agree. I'm also 99% sure that you don't (but not 100% so feel free to make me look dumb).
I'm going to try Sladuuch's suggestion of using the System Restore app. I'm at work now on a Windoze box, so I can't try this until I get home tonight.
lrwxr-xr-x 1 root wheel 59 May 6 21:30 javaws -> /System/Library/Frameworks/JavaVM.framework/Home/bin/javaws
lrwxr-xr-x 1 root wheel 57 Apr 29 21:00 java -> /System/Library/Frameworks/JavaVM.framework/Commands/java
lrwxr-xr-x 1 root wheel 65 Apr 29 21:00 java-rmi.cgi -> /System/Library/Frameworks/JavaVM.framework/Commands/java-rmi.cgi
lrwxr-xr-x 1 root wheel 58 Apr 29 21:00 javac -> /System/Library/Frameworks/JavaVM.framework/Commands/javac
lrwxr-xr-x 1 root wheel 60 Apr 29 21:00 javadoc -> /System/Library/Frameworks/JavaVM.framework/Commands/javadoc
lrwxr-xr-x 1 root wheel 58 Apr 29 21:00 javah -> /System/Library/Frameworks/JavaVM.framework/Commands/javah
lrwxr-xr-x 1 root wheel 58 Apr 29 21:00 javap -> /System/Library/Frameworks/JavaVM.framework/Commands/javap
-r-xr-xr-x 1 root wheel 31412 Mar 20 16:31 javatool
-r-xr-xr-x 1 root wheel 22368 Mar 20 16:31 javaconfig
Under :/System/Library/Frameworks/JavaVM.framework/Versions
drwxr-xr-x 8 root wheel 272 May 6 21:30 1.5.0
lrwxr-xr-x 1 root wheel 5 May 6 21:30 1.5 -> 1.5.0
drwxr-xr-x 6 root wheel 204 Apr 29 21:20 A
lrwxr-xr-x 1 root wheel 1 Apr 29 21:00 Current -> A
drwxr-xr-x 8 root wheel 272 Apr 29 21:00 1.3.1
lrwxr-xr-x 1 root wheel 5 Apr 29 21:00 CurrentJDK -> 1.4.2
lrwxr-xr-x 1 root wheel 5 Apr 29 21:00 1.3 -> 1.3.1
lrwxr-xr-x 1 root wheel 5 Apr 29 21:00 1.4 -> 1.4.2
drwxr-xr-x 8 root wheel 272 Jul 16 2004 1.4.2
Question: Where did they put java 1.5?
Answer:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands horus$ ./java -version
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-56)
Java HotSpot(TM) Client VM (build 1.5.0_02-36, mixed mode)
You could either make an alias to these versions for the interim until they release an easy fix or you can change the ln links for all under /System/Library/Frameworks/JavaVM.framework/Commands but then you have to change quite a few symlinks to these excutables and that's just not wise.
Better Commandline Alternative?
Debian Linux update-alternatives is the solution:
This utility manages all versions of commonly used executables for you.
Run the utility to reconfigure and/or add a new version and make it the default to suit your needs.
OS X could adopt a similiar strategy.
I have JDK1.5 and JDK1.4 on Debian. Before Debian recently updated their sun package options I added the options for the JDK1.5 into update-alternatives with resides under /etc/alternatives and choose whichever one I need.
The same goes for gcc and other various executable versions.
Originally posted by mdriftmeyer
/usr/bin horus$ ls -lt java*
I did a grep on the Developer directory, and here's what I found:
/Developer/ADC Reference Library/documentation/Java/java.html
Some applications look for Java?s home directory (JAVA_HOME) on the users system, especially during installation. If you need to explicitly set this, in a shell script or an installer, set it to /Library/Java/Home/. Setting it to the target of that symbolic link can result in a broken application for your customers. Programatically you can use System.getProperty("java.home"), as you would expect.
/Library/Java/Home/ also contains the /bin/ subdirectory where symbolic links to command-line tools like java and javac can be found. These tools are also accessible through /usr/bin/.
Note: Since the links in /usr/bin/ point to the tools for Java 1.4.2, to invoke Java 1.3.1 tools you must use the full path. For example, to run the Java 1.3.1 version of java use /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Commands/java.
Somebody needs to tell these guys to get a clue.
I think the one thing to remember is Apple has to cater to grandma and mom. Not many Linux users in that category, so it's not surprising the Linux distro's might have a few more focused power user tools when you get to non-OS X specific utilities.
I do agree with your point on the installer. PB's tip for Pacifist is the best solution going. It will pull out exactly what you want from the OS install CDs/DVD without going for a full OS install.
Originally posted by Hiro
Why? Having a default Java install is a necessity, and 1.4.2 isn't a bad choice as of the moment. Not everyone want's to be bleeding edge with 1.5 so you get a choice. Having to use a full path to the 1.3.1 tools when you have 1.4.2 and/or 1.5 installed hardly seems egregious. I'm not a Linux user, does your Gentoo solution allow all to be dynamically linked at the same time without hardcoding some type of selection criteria?
First of all, I think it's painfully obvious that you've never used Java and you have no idea what the you're talking about. I'm sure you've never developed any software of any kind either.
A software developer needs to be able to write and test their software against as many platforms as possible, most especially a "write once run anywhere" language such as Java. If I'm writing code against 1.4.2, you bet your ass I want to know how my code compiles on 1.5.0. I need to be able to switch back and forth between the different JDKs that I want to support, and I would be totally brain dead not to support 1.5.
You've probably never heard of ant either, or used any build program to compile your code. There's no ant task for:
/System/Library/Frameworks/JavaVM.Framework/Versions/1.5.0/bin/javac
The only task available is for javac, jikes or some other compiler command.
So, yes, having to use the full path isn't only eggregious, it's absolutely %#&#'ing stupid.
BTW, do you know how long 1.5 has been out? It's been well over 6 months. 1.4.2 is getting really old really fast. It makes absolutely no sense for Apple to be so far behind the curve, and to hold me back with them.
As for Gentoo, did you not read the link I posted:
http://www.gentoo.org/doc/en/java.xml#doc_chap3
3. Configuring your JRE/JDK
Overview
Gentoo has the ability to have multiple JDKs and JREs installed without them conflicting.
Using the java-config tool, you can set the system-wide default if you have root access. Users can also use java-config to set up their own personal default, that is different from the system-wide default.
Setting a default JRE/JDK
Running the command java-config --list-available-vms will give you a list of all available JREs and JDKs on your system. Here is an example of output:
Code Listing 3.1: Listing available VMs
# java-config --list-available-vms
[blackdown-jdk-1.3.1] Blackdown JDK 1.3.1 (/etc/env.d/java/20blackdown-jdk-1.3.1)
[blackdown-jre-1.3.1] Blackdown JRE 1.3.1 (/etc/env.d/java/20blackdown-jre-1.3.1)
[ibm-jdk-1.3.0] IBM JDK 1.3.0 (/etc/env.d/java/20ibm-jdk-1.3.0)
[ibm-jdk-1.3.1] IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1)
[ibm-jre-1.3.1] IBM JRE 1.3.1 (/etc/env.d/java/20ibm-jre-1.3.1)
[sun-jdk-1.4.0] Sun JDK 1.4.0 (/etc/env.d/java/20sun-jdk-1.4.0)
The name in the brackets "[]" is the handle or ID for that particular VM. You use pass that ID to java-config --set-system-vm. Here is an example of how to set the system VM.
Code Listing 3.2: Setting the System VM
# java-config --set-system-vm=ibm-jdk-1.3.1
Now using IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1)
Note: You will have to be root to run --set-system-vm.
Once you have issued java-config --set-system-vm with a particular VM ID, you will need to regenerate your /etc/profile.env. You can do it like this:
Code Listing 3.3: Regenerating /etc/profile.env
# env-update
After this, you will either want to relogin, or resource /etc/profile into your environment.
As a regular user, you can use java-config --set-user-vm, which will create ~/.gentoo/java-env with all required env vars. You would normally source this from your shell's startup script (generally ~/.bashrc).
So there it is, and it's mind-numbingly simple. Apple has made a name for itself by making the complex simple. It just failed miserably when it comes to such critically important functionality for Java developers.
I think the one thing to remember is Apple has to cater to grandma and mom. Not many Linux users in that category, so it's not surprising the Linux distro's might have a few more focused power user tools when you get to non-OS X specific utilities.
Successful software projects are those that empower the user without making assumptions about what the user wants and assuming the user is too stupid to make decisions. The latter is Microsoft's philosophy, and that's why they're losing customers. Apple has been mostly successful with OS X because that OS empowers the user. It allows users to start out with simple defaults, but tweak their software/settings as they become more advanced.
If your argument against allowing the user to set their default JDK is that it might "scare off mom and pop", then you're falling into the same reasoning that Microsoft uses to take power away from their users, which is absolutely the wrong way to set up a computer system. You don't take power away from a user because you assume they're stupid.
Also, if Apple were solely out to cater to mom and pop, then they wouldn't have built OS X on Unix, nor would they have wasted time developing XCode. They did this because they wanted to sell more hardware to AVANCED USERS.
I do agree with your point on the installer. PB's tip for Pacifist is the best solution going. It will pull out exactly what you want from the OS install CDs/DVD without going for a full OS install.
Yeah, well, I decided to do a clean reinstall. I shouldn't have to fiddle around with a third party solution to repair a package when Apple should provide the tool themselves.
And, yeah, I looked for the Software Restore program, and I couldn't find it.
Originally posted by JavaCowboy
Good God! Even Windows is easier for this! All I need to do is set $JAVA_HOME to the directory where my JDK is. Once $JAVA_HOME is set, the JDK is pointing to the right place. It really should be that simple.
That should work in Tiger too:
For developers using the command line simply define your JAVA_HOME environment var as needed and call the correct java tools (consider modifying your path for that).
Normally JAVA_HOME points at /Library/Java/Home which is a link to the 1.4.2 home directory listed below. You could redirect it as needed to one of the following (on Tiger).
/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
Originally posted by JavaCowboy
Yeah, well, I decided to do a clean reinstall. I shouldn't have to fiddle around with a third party solution to repair a package when Apple should provide the tool themselves.
You certainly didn't have to do that. When you install Tiger on top of an existing Tiger install it only installs the missing items.
Originally posted by JLL
That should work in Tiger too:
For developers using the command line simply define your JAVA_HOME environment var as needed and call the correct java tools (consider modifying your path for that).
Normally JAVA_HOME points at /Library/Java/Home which is a link to the 1.4.2 home directory listed below. You could redirect it as needed to one of the following (on Tiger).
/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
Nope. Didn't work.
Some developers ship, some researchers publish, some just bitch...
Send in the damn bug report with the Gentoo code/docs and get back to work.
Maybe refraining from making stupid incorrect judgments while you ride what you think is the high ground would help your clarity and make others more willing to help in the future. For now, stew in your own juices, we'll take the time advantage and put it to good use.
Originally posted by Hiro
I think JavaCowboy needs to lay off the caffeine!
Some developers ship, some researchers publish, some just bitch...
Send in the damn bug report with the Gentoo code/docs and get back to work.
Maybe refraining from making stupid incorrect judgments while you ride what you think is the high ground would help your clarity and make others more willing to help in the future. For now, stew in your own juices, we'll take the time advantage and put it to good use.
This is not a bug. This is an explicit design decision:
file:///Developer/ADC%20Reference%20Library/documentation/Java/Conceptual/Java14Development/index.html#//apple_ref/doc/uid/TP30001142
Apple makes it very clear that they don't support the notion of JAVA_HOME, nor do they support the notion of switching JDKs.
Since this is not a bug, it will not be fixed until a new version of OS X comes out. That's a year and half.
How is my judgement stupid?
It isn't, because even Windows supports the notion of JAVA_HOME, which lets me set whichever JDK I want on the fly. This is not ideal since it means setting an environmental variable, but it's good enough. Apple doesn't even allow for such a simple mechanism.
How is my judgement incorrect?
It isn't, because the link I provided above proves that this was a design decision on Apple's part. It is absolutely incredibly shortsighted, since even Windows provides functionality that they've consciously left out.
BTW, I sent TWO items to Apple via their Feedback form. If they listen, then this MIGHT make it to 10.5.
I'd be glad to work on some kind of framework to make this possible, but OS X is not an open source project, it's proprietary software. The only thing I could do is work on some sort of extension to get around this design flaw, like a script or something.
The reason I'm bitching is that Apple has totally mishandled their Java environment, and this needs to be brought to light.