![]() |
Using the default package - is there a special compiler flag?
Hi,
I know that it is illegal to use a class from the default package in a named package. But JBuilder 7 is able to somehome circumvent this problem even though it is set up with a recent sdk. Does anyone know if JBuilder sets a special flag that I can also set manually to get the same effect? I'm using badly written libraries that put some key classes in the default package. Thank you very much in advance. A positive response will make my life a whole lot easier. Bura |
Re: Using the default package - is there a special compiler flag?
Bura Tino wrote:
> I know that it is illegal to use a class from the default package in a named > package. But JBuilder 7 is able to somehome circumvent this problem even > though it is set up with a recent sdk. Does anyone know if JBuilder sets a > special flag that I can also set manually to get the same effect? JBuilder has its own compiler that doesn't yet implement this constraint. |
Re: Using the default package - is there a special compiler flag?
"Neal Gafter" <search-for-me-on-google@neal.gafter.com> wrote in message news:409D747F.3010808@neal.gafter.com... > Bura Tino wrote: > > I know that it is illegal to use a class from the default package in a named > > package. But JBuilder 7 is able to somehome circumvent this problem even > > though it is set up with a recent sdk. Does anyone know if JBuilder sets a > > special flag that I can also set manually to get the same effect? > > JBuilder has its own compiler that doesn't yet implement this constraint. > Not sure this is so. JBuilder allows you choose your own SDK. I guess it's possible that they only use the VM and not the compiler. But in any case, was your answer pertaining to JBuilder or was it essentially "no, there's no way to enable javac to do that"? Thanks Bura |
Re: Using the default package - is there a special compiler flag?
On Sun, 09 May 2004 00:33:32 GMT, Bura Tino wrote:
> "Neal Gafter" ..wrote in message >> Bura Tino wrote: >>> I know that it is illegal to use a class from the default package in a > named >>> package. But JBuilder 7 is able to somehome circumvent this problem even >>> though it is set up with a recent sdk. .... >> JBuilder has its own compiler that doesn't yet implement this constraint. >> > Not sure this is so. (chuckles) Trust me. Neal knows more about compilers (particularly javac) than most of us ever want to know. ;-) >...JBuilder allows you choose your own SDK. So does javac.. You use the -bootclasspath option to point it at any rt.jar, I do so in my on-line compiler, which even allows people to compile code aginst the MSVM.. <http://www.physci.org/javac.jsp?bcp=MS> >...I guess it's > possible that they only use the VM and not the compiler. > > But in any case, was your answer pertaining to JBuilder or was it > essentially "no, there's no way to enable javac to do that"? The way I read Neal's comment, no, javac cannot do that. -- Andrew Thompson http://www.PhySci.org/ Open-source software suite http://www.PhySci.org/codes/ Web & IT Help http://www.1point1C.org/ Science & Technology |
Re: Using the default package - is there a special compiler flag?
Bura Tino wrote:
> But in any case, was your answer pertaining to JBuilder or was it > essentially "no, there's no way to enable javac to do that"? There is no way to enable javac to do that. It's not allowed by the language specification, which is why the reference implementation doesn't support it. With the exception of the -source flag that selects among the versions of the language specification javac is asked to comply with, there are no compiler flags that are intended to relax the set of programs javac will accept. |
Re: Using the default package - is there a special compiler flag?
"Neal Gafter" <search-for-me-on-google@neal.gafter.com> wrote in message news:409DA078.8010703@neal.gafter.com... > Bura Tino wrote: > > But in any case, was your answer pertaining to JBuilder or was it > > essentially "no, there's no way to enable javac to do that"? > > There is no way to enable javac to do that. It's not allowed by the language > specification, which is why the reference implementation doesn't support it. > With the exception of the -source flag that selects among the versions of the > language specification javac is asked to comply with, there are no compiler > flags that are intended to relax the set of programs javac will accept. > This answer is very clear an unequivocal. Thank you. I'm still left wondering how those library developers compiled their code. (In particular, I'm talking about the lamentable JMatLink.) Also, is it suprising in the context of language specification, that once a "packaged" class A, which uses the "default-packaged" class B is compiled (by that old and special JBuilder compiler) it can be then used on all vm's? |
Re: Using the default package - is there a special compiler flag?
Bura Tino wrote:
> I'm still left wondering how those library developers compiled their code. > (In particular, I'm talking about the lamentable JMatLink.) Using older or noncompliant compilers. > Also, is it suprising in the context of language specification, that once a > "packaged" class A, which uses the "default-packaged" class B is compiled > (by that old and special JBuilder compiler) it can be then used on all vm's? Not surprising. The JVM is a completely different language than Java, though it is intended to support Java well. |
Re: Using the default package - is there a special compiler flag?
Hello, Neal Gafter !
You wrote: > Bura Tino wrote: > > But in any case, was your answer pertaining to JBuilder or was it > > essentially "no, there's no way to enable javac to do that"? > > There is no way to enable javac to do that. It's not allowed by the language > specification, which is why the reference implementation doesn't support it. I realize that you are an expert on javac matters, but I think you are overstating what the spec says. I was in many discussions on thos topic years ago when it was allowed by javac and the only compiler that didn't support it was Visual AgeFor Java. There were people who claimed VAJ was non-compliant because it didn't support. The spec does not forbid importing from the unnamed package, but does allow a host to not support it. A system can support it and would not be non-compliant as you claimed in another message, otherwise javac was non-compliant before 1.3. -- Dale King My Blog: http://daleking.homedns.org/Blog |
| All times are GMT. The time now is 01:16 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.