0

So I coded up a simple test program for an algorithm in Eclipse 3.7.2. When I went to go run it, I was met with some gray bar that appeared on the top portion of the console. It reads: <terminated> test[Java Application]C:\Program Files\Java\jre6\bin\javaw.exe. Anyone know what's causing this? enter image description here

4
  • you should show a picture or something to make it more clear what the problem is. Commented Nov 14, 2012 at 5:21
  • Both requests have been filled. Commented Nov 14, 2012 at 5:25
  • 1
    It looks like your application finished running. It never reached a println so it didn't print to the console. Commented Nov 14, 2012 at 5:28
  • I think you're right. I just put another print statement at the very beginning of the function, and that worked. If you post this as an answer, I'll be glad to accept it. Commented Nov 14, 2012 at 5:30

2 Answers 2

4

Your program is executing properly. The problem is in the logic of your program which is never allowing it to reach the print statement. When you do

if(s==original) return; 

This statement s==original always returns true in your case since this operator will compare the two objects. You need to rethink your logic here and google about what == operator does in Java.

Also, on another note, instead of using an array String[] s = {"a","b","c"}, why dont you use a string String s = "abc";

Sign up to request clarification or add additional context in comments.

Comments

0

You Need to go to Control Panel > Windows Firewall and select Restore defaults but if you don't want to lose other settings, you could try Advanced Settings and find eclipse in there.

5 Comments

How does this pertain to the question?
I think You need to ask before down voting.This error often comes due to some windows java permission and resolve after setting firewall setting.I think you should remove your down vote and don't disappoint me from here
It isn't an error at all. His program ran successfully. And what do you mean "don't disappoint me from here"?
I know his program is running but it is still terminating.It will cause him some other issues if this guy is working in permitted environment.AND by this statement "don't disappoint me from here" I mean that I am disappointed to share my experiences if peoples do down vote like this.Anyway I respect your reason and accept your way of thinking.
@Austin When someone makes an attempt to post or answer what is the whole point in down voting? There could be different solutions, it is the OP to decide whether which is correct and which one not the correct answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.