Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #14039

Re: my java is broken !

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: my java is broken !
References <jnjb8s$vlu$1@dont-email.me> <jnjj1m$8iu$2@dont-email.me> <jnkett$idc$1@dont-email.me>
Message-ID <FPjnr.25381$Ec.348@newsfe16.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2012-04-29 20:06 -0300

Show all headers | View raw


On 12-04-29 07:21 PM, bilsch wrote:
> On 04/29/2012 07:25 AM, Joshua Cranmer wrote:
>> On 4/29/2012 7:13 AM, bilsch wrote:
>>> I wrote a loop to read a 26000 character text file NVRAM.TXT into a
>>> character array. It worked fine. The program is listed below. It has
>>> only 24 lines. Today when I run it, it has weird errors referenced to
>>> line numbers 2442, 2685 and 1620. When I click on those error messages
>>> it shows lines in a completely different program - a program that I
>>> never wrote for sure. I saved the file with a different name and it runs
>>> fine with that name - no errors. The file name that has the problem is
>>> Nvj5. That is the file selected and displayed when I click RUN FILE. It
>>> is the file listed below. Even though it is selected and displayed when
>>> I click RUN FILE my system is running some other huge file instead. Has
>>> anyone ever heard of a problem like this?
>>
>> When you refuse to mention error messages, the answer becomes "I have no
>> clue."
>>
>> It would also help to know what the command line is that is causing it.
>> It could be that your IDE is buggy, too (since it sounds like you rely
>> on a specific IDE feature).
>>
> I can't tell you the error messages now because I deleted the offending
> file - so can't generate errors anymore.  It seems the error messages
> are irrelevant since they point to lines in some large unknown program.

Your system is not "running" some other "file", not in the sense that
you think. Your Java source files are compiled into .class files, these
are loaded up into memory as required, and broadly speaking it's the
bytecodes in these class files that get executed ("run"). The first
application code to execute is the proper main() method in your main
class...like Nvj5.main(). Since you are using standard library code
also, like FileInputStream, code in those classes - and in the classes
that FileInputStream uses, and so on and so on - also gets executed.

That mysterious huge file is a standard library class that your code
needs to work. It's not irrelevant. A high percentage of the time when
you write buggy code the errors start in library code, not in your own
code. You need to look at the entire stack. You will notice that
somewhere in the stack are line references to your own code also.

You deleted and renamed *which* files exactly? Also, you have a class
Nvj5 but a corresponding source file "Nvj5.java".  You'll find that
people understand you better if you differentiate between data files
(like NVRAM.TXT) and source files (like Nvj5.java).

Are you saying that you renamed class Nvj5 in source file Nvj5.java to
class Pwll12 in source file Pwll12.java, say, and ever since your
program has run like a charm? That seems highly unlikely. In fact that's
astronomically unlikely.

What IDE or programming text editor are you using? How many "main"
classes are currently available in your workspace? When you tried that
failing run did you see any console output at all?

AHS
-- 
A fly was very close to being called a "land," cause that's what they do
half the time.
-- Mitch Hedberg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

my java is broken ! bilsch <king621@comcast.net> - 2012-04-29 05:13 -0700
  Re: my java is broken ! bilsch <king621@comcast.net> - 2012-04-29 05:36 -0700
    Re: my java is broken ! Roedy Green <see_website@mindprod.com.invalid> - 2012-04-29 07:05 -0700
  Re: my java is broken ! Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-04-29 09:25 -0500
    Re: my java is broken ! bilsch <king621@comcast.net> - 2012-04-29 15:21 -0700
      Re: my java is broken ! Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-29 20:06 -0300
        Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-03 15:03 -0700
          Re: my java is broken ! Lew <lewbloch@gmail.com> - 2012-05-03 16:05 -0700
            Re: my java is broken ! Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-03 20:44 -0300
              Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-03 22:38 -0700
                Re: my java is broken ! Lew <lewbloch@gmail.com> - 2012-05-04 06:43 -0700
                Re: my java is broken ! Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-05-04 14:07 +0000
                Re: my java is broken ! Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-04 09:11 -0500
                Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-04 15:06 -0700
                Re: my java is broken ! Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-04 23:06 +0000
                Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:03 -0700
                Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:04 -0700
                Re: my java is broken ! Lew <lewbloch@gmail.com> - 2012-05-04 17:04 -0700
                Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:30 -0700
                Re: my java is broken ! markspace <-@.> - 2012-05-05 15:58 -0700
                Re: my java is broken ! Lew <noone@lewscanon.com> - 2012-05-05 22:37 -0700
                Re: my java is broken ! Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-04 19:48 -0500
                Re: my java is broken ! Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-05 15:02 +0000
                Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:26 -0700
                Re: my java is broken ! Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-05 22:57 +0000
                Re: my java is broken ! Lew <noone@lewscanon.com> - 2012-05-05 22:41 -0700

csiph-web