FreeBSD - "Class.getClasses" problem

From: Michael Wright (mwright_at_ubiquity.net)
Date: 10/06/03


Date: 6 Oct 2003 03:17:28 -0700

I'm using Java 1.4.1, on FreeBSD 5.1.

I have a problem where I'm attempting to use reflection to get a list
of the classes that a given class extends. The problem is that the
method call "Class.getClasses()" always returns an empty array, when
it is called. I've tried it with a number of different classes, my
own, and the standard API classes, always getting back the same
result. The "Class.getDeclaredClasses()" also has the same problem.

I used the following code to verify this behaviour:

////////////////////////////////
Class[] aclassExtends = Class.forName(strClassName ).getClasses();
for (int iClassIndex = 0; iClassIndex < aclassExtends.length;
++iClassIndex )
{
    Class classExtend = aclassExtends[iClassIndex ];
    System.out.println("class:" + classExtend.getName() );
}
////////////////////////////////

This should output the names of all classes and interfaces that the
given class extends and implements. It works on other OS (tested on
OSX and Windows 2K), but not on FreeBSD.

Has anybody else experienced this problem? If so, is there a patch or
a workaround available?

Any help would be appreciated.

Thanks,
Michael



Relevant Pages

  • Re: netbeans 6.0.1 not run
    ... I'm using zsh so I set JAVA_HOME and PATH of java into in my .zshrc. ... Then I insralled netbeans from ports, ... Installation went fine. ... graphical java application on FreeBSD 7 using the diablo port. ...
    (freebsd-questions)
  • Re: JAVA for FreeBSD
    ... >> Because they want that an officially endorsed Java virtual machine be ... >> able to run any java programs exactly the same as on other platforms. ... >> even now the most modern FreeBSD thread library is able to run perfectly ... JDK for your linux-distribution that wasn't included on the CD. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: where exactly can I get a copy of libdl.so.2 for FreeBSD-5.4 ?
    ... because no such FreeBSD library exists. ... I imagine you'll be able to get them if you check the docs on enabling linux compat. ... Linux java plugin. ... linux mozilla binary with the linux java plugin, ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Java5 and FreeBSD
    ... I made my way to Sun's java page, and then to the newest Java2 ... Yet no FreeBSD Java? ... The linux one will probably work ... > Server Platform Edition 8 is available for the following platforms: ...
    (freebsd-questions)
  • Re: quota deadlock on 6.1-RC1
    ... beta releases and when the final release candidates appear, ... cause new bugs as well. ... Java _isn't_ part of the base system. ... the main FreeBSD release at all. ...
    (freebsd-stable)