 |
 |
Is mac os x's java limited?
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2001
Status:
Offline
|
|
So my company writes a product that uses a java based admin too. We never supported os x, but it always worked anyway. However, someone just added a java class (sun/awt/VerticalBagLayout.class) that mac os x doesn't seem to have and it broke everything. After some inspection of the solaris jdk, it seems like the mac is missing a lot of java classes. In fact, the entire rt.jar file seems to be missing. I was able to get around the problem by adding that file to my program's jar file. It was definatly a pain though. Mac os x also seems to do some strange things when it comes to java and classpaths...
So my question are as follows:
1. Is apple missing out on some compatibility by not including classes that are in all other jdks?
2. What's the deal with frameworks? Why don't they just put everything in /usr/local/jre?
3. what is the proper way to set classpaths and JAVA_Home under mac os x? Why would mac os x have trouble picking up a jar file of sun/awt/VerticalBagLayout.class that is in my class path, but not when I put that file into the jar file that my application live in?
I know there is a lot here.... but any info from developers who use java would be much appreciated.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status:
Offline
|
|
The big question here is what version of Java are you comparing to. Apple has the 1.3.1 Standard Edition. If you are looking for Enterprise Edition or things out of 1.4 (not quite officially out.. in beta) then they should not be there (some are for odd reasons).
The answer to the whole frameworks question is that Apple has modified some things to integrate them with Cocoa (both for WebObjects and for Cocoa-Java Programs). This is the way they chose to do it. Not sure about the problems you are having with classpaths, I get the expected results.
I am sure that Apple will be one of the first third parties to adopt Java 1.4 when it comes out, but right now Sun is the only one doing anything big, because the spec is not finalized. As Sun makes the Solaris and Windows versions of the JRE, these have betas....
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status:
Offline
|
|
re: sun.awt.VerticalBagLayout.class is a sun class as you noticed in the path. They may have been in the JDK 1.0 but are defintely not in the presently used JDK's including 1.1 and 1.4. I seem to remember sun saying in the documentation years ago that the Sun classes were not guaranteed to be in any future release of the JDK as they were not part of the standard jdk.
But...
If you look at sourcebot.com you'll notice that the sun class just imports java.awt.* and implements an interface. There is nothing to stop you taking this source and compiling it in with your application and then just importing the package sun.awt in other places in your application.
|
|
weird wabbit
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status:
Offline
|
|
Originally posted by barry_black:
<STRONG>So my company writes a product that uses a java based admin too. We never supported os x, but it always worked anyway. However, someone just added a java class (sun/awt/VerticalBagLayout.class) that mac os x doesn't seem to have and it broke everything. After some inspection of the solaris jdk, it seems like the mac is missing a lot of java classes. In fact, the entire rt.jar file seems to be missing. I was able to get around the problem by adding that file to my program's jar file. It was definatly a pain though. Mac os x also seems to do some strange things when it comes to java and classpaths...
</STRONG>
As has been said, sun.awt.VerticalBagLayout is NOT part of the JDK. You guys have hooked into an implementation class that does not exist everywhere. I am not bashing the practice as I have had to do it myself, just don't file it as a 'bug report' against the 'incomplete' Mac OS X JDK. Everything that is required to be in the J2SE version 1.3 is there. I have not had any issues with classpaths and such. Also, rt.jar is not a required part of the JDK either - it is a detail. FWIW, the 'standard' place to install the JDK is in /usr/java, not /usr/local/jre, so no matter what there is some give and take. If your environment is too unmanageable with the framework path, just provide a symbolic link to where you want it to be.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|