aspose file tools*
The moose likes Java in General and the fly likes Java 5->6 or Windows->Mac class loading differences? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java 5->6 or Windows->Mac class loading differences?" Watch "Java 5->6 or Windows->Mac class loading differences?" New topic
Author

Java 5->6 or Windows->Mac class loading differences?

Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Hi,

Does anyone know of any differences in how class loading works, between Java 5 and Java 6? Or perhaps between Sun Windows Java 6 JVM and Mac Java 5 JVM?

I have an application with a custom class loader. It seems to be working fine on Windows and to be having problems on Mac OS X. I would expect them both to be the same.

It's possible that the difference is in fact one of timing, between my Mac and my PC, rather than platform, but I thought I'd ask the question.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

It's not anything as trivial as path separator or directory name separator differences, is it? ':' and '/' on Mac OS X, and ';' and '\' on Windows?


[Jess in Action][AskingGoodQuestions]
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Er, no. This application has been working fine on Mac, Linux and Windows, for years, so those types of issues were sorted out ages ago.
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Looks like the problem may be due to the Mac "losing" the context class loader.

My app sets the main thread's context class loader, as the second statement in the whole app (constructing the loader is the first). All other threads ought to inherit that, as they're all descendents of main. But I find that there's sometimes a null context class loader, on the Mac.

That never happens on Windows.

Trying now to tie this down fully, so we double-check the bug's really Apple's. The alternative would be that it's in a third-party library (but then why only on Mac?).
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14432
    
  23

I don't have a Mac, so I don't know of any differences in classloading. It is possible that it's a bug in either Sun's Java or Apple's Java for the Mac. You could try searching Sun's bug database, or Apple's (I don't know if they have a public bug database).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java 5->6 or Windows->Mac class loading differences?