Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Is mac os x's java limited?

Is mac os x's java limited?
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2001
Status: Offline
Reply With Quote
Dec 6, 2001, 03:18 PM
 
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
Reply With Quote
Dec 7, 2001, 12:02 AM
 
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
Reply With Quote
Dec 10, 2001, 11:41 AM
 
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
Reply With Quote
Dec 10, 2001, 04:49 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:59 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2