Board index » jbuilder » non case-sensitive filename question

non case-sensitive filename question


2004-07-22 07:54:57 PM
jbuilder4
Interesting question:
If I create a java file called "thisismyfile.java" and the class
contained therein is called "ThisIsMyFile", JBuilder (I'm
currently using version 7) will build the project just fine.
When compiling the same file at the command line using javac, it
will not.
I was under the impression that the class name was required to
match the filename in a java environment (case included). Why
does Jbuilder work under this situation? How can I force it to
tell me when I have an inconsistancy between the file name and
the class name?
Thank you in advance,
S. Glasgow
 
 

Re:non case-sensitive filename question

On 7/22/2004 at 7:54:57 AM, SRG wrote:
Quote
I was under the impression that the class name was required to
match the filename in a java environment (case included). Why
does Jbuilder work under this situation?
I presume you are working with a Windows filesystem. The fact that it is
case-insensitive could cause problems when trying to match the class name
with the file name. I presume that the compiler writers must have decided
to be a little lenient in that case.
Note that as of JBuilder 9, JB uses the Sun "javac" compiler by default,
so this is no longer an issue.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

Re:non case-sensitive filename question

"John McGrath [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote
On 7/22/2004 at 7:54:57 AM, SRG wrote:

>I was under the impression that the class name was required to
>match the filename in a java environment (case included). Why
>does Jbuilder work under this situation?

I presume you are working with a Windows filesystem. The fact that it is
case-insensitive could cause problems when trying to match the class name
with the file name. I presume that the compiler writers must have decided
to be a little lenient in that case.

Note that as of JBuilder 9, JB uses the Sun "javac" compiler by default,
so this is no longer an issue.

--
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
John,
I am working under Redhat Linux 9.0. Are you suggesting that I
upgrade to the latest version of JBuilder?
Thank you,
Steve
 

{smallsort}

Re:non case-sensitive filename question

SRG wrote:
Quote
I am working under Redhat Linux 9.0. Are you suggesting that I
upgrade to the latest version of JBuilder?
You're working on Linux, and getting the case of the filename wrong? Whoa.
No, he's saying fix your file names so that they match the class names
*exactly* (including case). And he's saying that JB9 and later will be
as strict as Javac (and thus will reject case mismatches always).
 

Re:non case-sensitive filename question

On 7/23/2004 at 12:46:04 PM, SRG wrote:
Quote
I am working under Redhat Linux 9.0. Are you suggesting that I
upgrade to the latest version of JBuilder?
In addition to what Shankar said, I should add that I was guessing you
were working with a case-insensitive Windows filesystem, which I guess is
not the case.
However, I still suspect that the code was written that way because of
case-insensitive filesystems, since it is not easy to determine whether
the filesystem is case-sensitive or not. The fact that you are using
Linux does not guarantee that your filesystem is case-sensitive.
I do not think this is a reason in itself to upgrade your copy of
JBuilder. If you want to be sure that your code does not have this flaw,
you can always write an Ant script and compile it using Sun's "javac". Of
course, there are many nice features in the newer versions of JBuilder, so
you might want to upgrade in order to get some of them.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html