This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 24166
    
  30

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: 13863
    
  10

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 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java 5->6 or Windows->Mac class loading differences?
 
Similar Threads
Reading from java complete referece java5
Check Java version programmatically
Survey- What platform do you use to program in Java?
Differences between Java 1.4.2 and Java 5
Difference between Java 5 and Java 6