Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Using the default package - is there a special compiler flag? (http://www.velocityreviews.com/forums/t133285-using-the-default-package-is-there-a-special-compiler-flag.html)

Bura Tino 05-08-2004 03:13 PM

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



Neal Gafter 05-08-2004 11:59 PM

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.


Bura Tino 05-09-2004 12:33 AM

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



Andrew Thompson 05-09-2004 01:02 AM

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

Neal Gafter 05-09-2004 03:07 AM

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.


Bura Tino 05-09-2004 05:11 AM

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?



Neal Gafter 05-10-2004 04:26 AM

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.


Dale King 04-15-2006 03:44 AM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57