Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java Eclipse console not working [SOLVED (false alarm)]
icon4.gif  Java Eclipse console not working [SOLVED (false alarm)] [message #870813] Wed, 09 May 2012 14:46 Go to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
Alrite this one's a major bug so that's an alert to all those who use it, beware:

the bug is simple actually: the console doesn't work

but first off, the specs:

dual core CPU (old), 2 GB RAM running WinXP

file downloaded was a zip file, 128Mb (unzipped: 156Mb)
(I tried another version before, slightly bigger file but can't remmber the size, same bug)

I'm kinda new to Java (did a 2 month crash course, we used something called Notepad++ and it was perfect & easy to use, unfortunately the company I'm gonna work for likes to complicate things Very Happy so they're using Eclipse, so I've to learn how this stuff works rather soon)


now this is a serious bug cause even simple programs don't work

I tried Hello World program, here's the screencaps:

before running:

img802.imageshack.us/img802/47/fore.jpg

after running (run as java application):

img715.imageshack.us/img715/2148/afth.jpg

=> a console is "created" but stays blank, NO OUTPUT

I tried right-click+run on different things in the left menu (on helloworld.java, on helloworld, on main(string[]) etc. ), same result (none)


btw this is a really serious bug as it makes the entire thing useless so this alert outa be passed around on other java forums




ps. apparently this is a really new bug cause even google can't help Confused

[Updated on: Sun, 13 May 2012 18:38]

Report message to a moderator

Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #870889 is a reply to message #870813] Thu, 10 May 2012 03:46 Go to previous messageGo to next message
Joop Lanting is currently offline Joop Lanting
Messages: 8
Registered: July 2009
Junior Member
Which version ECLIPSE are you talking about?
3.8M7 and 4.2M7 are still on hold.

;JOOP!
Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #870941 is a reply to message #870889] Thu, 10 May 2012 06:05 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam Kandula
Messages: 444
Registered: July 2009
Senior Member
Probably java is exiting before the flush happens to the console. Try putting the following line after the println.
System.out.flush();
Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #870948 is a reply to message #870941] Thu, 10 May 2012 06:28 Go to previous messageGo to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
Satyam Kandula wrote on Thu, 10 May 2012 06:05
Probably java is exiting before the flush happens to the console. Try putting the following line after the println.
System.out.flush();
thx for the help but nope, that dont change nothing, console stays blank Sad

besides the prog works fine in DOS shell without the flush line

(btw aint Java suppose to handle memory management on its own? unlike C)



anyone else got that prob? I mean thats a REALLY serious bug & I cant believe them developers didnt see it Confused


J.F.Lanting Mising name wrote on Thu, 10 May 2012 03:46
Which version ECLIPSE are you talking about?
3.8M7 and 4.2M7 are still on hold.

;JOOP!
I dunno, About Eclipse only says :

Eclipse IDE for Java Developers

Version: Indigo Service Release 2
Build id: 20120216-1857
(c) Copyright Eclipse contributors and others 2000, 2012. All rights reserved.
Visit eclipse.org/

This product includes software developed by the
Apache Software Foundation /apache.org/


[Updated on: Thu, 10 May 2012 06:31]

Report message to a moderator

Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #870992 is a reply to message #870813] Thu, 10 May 2012 09:39 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Do you mean the java.io.Console?

PW


Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871017 is a reply to message #870992] Thu, 10 May 2012 10:33 Go to previous messageGo to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
Paul Webster wrote on Thu, 10 May 2012 09:39
Do you mean the java.io.Console?

PW
not sure what u mean by that (is 'java.io.console' a piece of code that we've to type? I never used it in my .java source files)


I mean the lower-left window in the 2 pictures I posted (in my 1st post):

here's the 2nd pic again:

img715.imageshack.us/img715/2148/afth.jpg

as u can see, a console appears in lower-left of the screen after execution, but it remains blank Evil or Very Mad

[Updated on: Thu, 10 May 2012 10:34]

Report message to a moderator

Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871024 is a reply to message #871017] Thu, 10 May 2012 10:45 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You're code works for me. After you run, does anything show up if you right-click in the console window and "Select All"?

PW


Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871053 is a reply to message #871024] Thu, 10 May 2012 12:41 Go to previous messageGo to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
Paul Webster wrote on Thu, 10 May 2012 10:45
You're code works for me. After you run, does anything show up if you right-click in the console window and "Select All"?

PW
nope console stays blank, just a blinking cursor


btw my code works too - in DOS shell. so this is an eclipse bug

unless there's another eclipse version that works? (there's lot of files to download on eclipse site so it aint easy to know which one's the right one)

[Updated on: Thu, 10 May 2012 12:41]

Report message to a moderator

Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871067 is a reply to message #871053] Thu, 10 May 2012 13:32 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

That's the current release version, and has been out since Feb 2012. If the console didn't work correctly for hello world there should be tonnes of bugs about it.

The select all was to see if there was a font problem (like white on white).

Have a look a the launch config for your java app (ALT+R N). At the end there should be a "Common" tab. Is "Allocate Console" checked (it should be)?

If that doesn't work, then I would open a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform&component=Debug for 3.7.2

PW


Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871101 is a reply to message #871067] Thu, 10 May 2012 16:43 Go to previous messageGo to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
yup, allocate console is checked Sad

I tried another version of Eclipse a few weeks ago (that eclipse was bigger like over 250Mb zip file or something) then I tried the version I'm using now (smaller, only 128Mb zip file and it's called indigo), both have same bug

I dunno if there's other versions of the same version# (cause apparently there's several Java Eclipses instead of just one...)
Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871369 is a reply to message #871101] Sat, 12 May 2012 11:03 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 977
Registered: July 2009
Senior Member
Hanz,
sure if Eclipse wouldn't be able to run a Hello-World Java program that would be really bad.
Apparently it works for many many people, and the question here is, what makes your case different.

The first thing that comes to my mind: what operating system / windowing system do you use?

Next: which exact Java runtime do you use.

Some information can be retrieved using the debug perspective:
after running your program, find a line starting with "<terminated, exit value.." in the Debug view:
- what exit value is shown?
- when you open right-click "Properties" on that line, what is the exact Command Line: shown?
Is that the same command you typed at the DOS prompt?

If Eclipse failed to launch your program perhaps an error was logged in the "Error Log" view.

Finally, as you mention your company forcing you to use Eclipse: I'm sure there are lots of folks who can spot the issue by looking at your machine, much easier than if we are guessing remotely what might have happened. If it turns out to be an Eclipse bug, we do appreciate a bug report as Paul mentioned, but for that we need more information than just the fact that it doesn't work.

HTH,
Stephan
Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871402 is a reply to message #871369] Sun, 13 May 2012 07:32 Go to previous messageGo to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
thx 4 the help Cool

but it's not "my company" YET atm I'm still @ home on my personal PC so I'm my own Sad

anyway to answer the questions:

Stephan Herrmann wrote on Sat, 12 May 2012 11:03

The first thing that comes to my mind: what operating system / windowing system do you use?
Windows XP, sp3

Quote:
Next: which exact Java runtime do you use.
I'm not even sure what a java runtime is - is that what they call java virtual machine? the java.exe file? or javac.exe? or that thing they call JDK? (whatever it is)

in Control Panel Add/Remove Programs there are 2 lines that say Java(TM) 7 Update 1 and Java(TM) SE Development Kit Update 1

Quote:
Some information can be retrieved using the debug perspective:
after running your program, find a line starting with "<terminated, exit value.." in the Debug view:
- what exit value is shown?
it says

<terminated>helloworld [Java Application]
<terminated, exit value: 0>C:\Program Files\Java\jre7\bin\javaw.exe (13 may 2012 13:15:06)


(having done some C before I suppose an exit value of 0 means "no error" which means it says everything is working fine...which it obviously aint Confused )

Quote:
- when you open right-click "Properties" on that line, what is the exact Command Line: shown?

C:\Program Files\Java\jre7\bin\javaw.exe" -Dfile.encoding=Cp1252 -classpath C:\workspace\bonjourmonde\bin helloworld

('bonjourmonde' is the name of the "project" cause I had to give it a name, gave it a different name from the 'helloworld' class itself so as not to get confused...I'm not sure what the hell "project" is but I suspect it's only an Eclipse thing, not something intrinsic to java language. I never used projects when I was doing java in notepad+DOS mode)

Quote:

Is that the same command you typed at the DOS prompt?
nope in DOS I don't use the javaw.exe file, instead I used javac.exe & java.exe

first I type javac helloworld.java (this creates a class file)
then I type java helloworld (this runs the prog & shows the output)


Quote:
If Eclipse failed to launch your program perhaps an error was logged in the "Error Log" view.
apparently Eclipse does launch it, it's just the console that wont work :/

anyway

when I open Eclipse (before runing any prog) it says :

Failed to retrieve default libraries for C:\Program Files\Java\jre7
org.eclipse.epp.package.java.product


and if I right-click & copy the message it apparently puts something much longer in the clipboard:

eclipse.buildId=M20120208-0800
java.version=1.7.0_01
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product

Error
Sun May 13 13:27:52 CEST 2012



running the prog however doesn't create any xtra error messages



[Updated on: Sun, 13 May 2012 07:36]

Report message to a moderator

Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871413 is a reply to message #871402] Sun, 13 May 2012 10:12 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 977
Registered: July 2009
Senior Member
Hanz Gunz wrote on Sun, 13 May 2012 13:32
it's not "my company" YET atm I'm still @ home on my personal PC so I'm my own Sad


Hanz, I mean no offense, but given your lack of knowledge about IDEs in general and Eclipse in particular, you might be better off clearly mentioning to your future employer that you need some training in this field. If you feel you can work better with notepad++ than with an IDE this is something your company needs to know, IMHO.

Your specifications look pretty normal, except that Windows XP + Java 7 might be an unusual combination of old and new. Actually your screenshots didn't look like Windows XP to me, but I may be wrong here.

Hanz Gunz wrote on Sun, 13 May 2012 13:32
in Control Panel Add/Remove Programs there are 2 lines that say Java(TM) 7 Update 1 and Java(TM) SE Development Kit Update 1

It seems you have two Java installations: a JRE (runtime only) and a JDK (development) installation.

Hanz Gunz wrote on Sun, 13 May 2012 13:32
it says

<terminated>helloworld [Java Application]
<terminated, exit value: 0>C:\Program Files\Java\jre7\bin\javaw.exe (13 may 2012 13:15:06)


So Eclipse is using the JRE installation.

Hanz Gunz wrote on Sun, 13 May 2012 13:32
in DOS I don't use the javaw.exe file, instead I used javac.exe & java.exe

javac is not part of the JRE so here you must be using the other Java install.
So this is a difference between your DOS-prompt experiments and Eclipse.
It should be worth an experiment to use the JDK for Eclipse, too.

Hanz Gunz wrote on Sun, 13 May 2012 13:32
when I open Eclipse (before runing any prog) it says :

Failed to retrieve default libraries for C:\Program Files\Java\jre7
org.eclipse.epp.package.java.product


Interesting, looks like https://bugs.eclipse.org/bugs/show_bug.cgi?id=267384
Supposedly, this message is harmless, but I don't know.


If you think this is a Console-only problem, why don't you debug into the program to see if it is executing properly?

best,
Stephan
Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871439 is a reply to message #871413] Sun, 13 May 2012 14:09 Go to previous messageGo to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
I said this to my future boss, but he says it's easy to learn - but problem is I first gotta get it working! :/

Quote:
Your specifications look pretty normal, except that Windows XP + Java 7 might be an unusual combination of old and new. Actually your screenshots didn't look like Windows XP to me, but I may be wrong here.
(that's cause I use 'classic windows' look Cool )

so could xp+java7 combo be the problem?

IO could try a windows 2003+eclipse test (on a virtual machine) but that kinda setup takes looong time...only gonna try it as last resort

Quote:
It seems you have two Java installations: a JRE (runtime only) and a JDK (development) installation.
whats the difference?

also can I safely remove one of the two?


Quote:
It should be worth an experiment to use the JDK for Eclipse, too.
how do I do that? Confused


edit> I notice that javaw.exe is found in both JRE and JDK folders (but javac.exe & java.exe only found in JDK folders)


Quote:
If you think this is a Console-only problem, why don't you debug into the program to see if it is executing properly?
I suppose you mean click on the green bug icon instead of the green arrow (run) icon

when I do that I get an error it says
"launching helloworld has encountered a problem
cannot find a free socket
(whatever that is) for the debugger"




btw you said Eclipse uses JRE, so this means JRE is the bugged one right? so what if I uninstall the JRE thingie and leave JDK only, will Eclipse work?

[Updated on: Sun, 13 May 2012 14:13]

Report message to a moderator

Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871442 is a reply to message #871439] Sun, 13 May 2012 15:26 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 977
Registered: July 2009
Senior Member
Hanz Gunz wrote on Sun, 13 May 2012 20:09

so could xp+java7 combo be the problem?


Just a guess: XP is quite old, whereas java7 is the latest.

Hanz Gunz wrote on Sun, 13 May 2012 20:09
IO could try a windows 2003+eclipse test


I don't think Java7 is supported on Windows Server 2003.

Hanz Gunz wrote on Sun, 13 May 2012 20:09
I suppose you mean click on the green bug icon instead of the green arrow (run) icon

when I do that I get an error it says
"launching helloworld has encountered a problem
cannot find a free socket
(whatever that is) for the debugger"


OK, so there is a problem launching Java applications in debug mode. It doesn't look like that machine isn't in a very healthy state.

Other than that, sorry, that's a bit too many questions for me to answer. Not sure if other members of this forum want to chime in. I suggest you find a local friend who already uses Eclipse to have a look at your machine.

best,
Stephan

PS: Next time before you raise a major-bug-alarm, please make sure you know exactly what you are doing.
Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871464 is a reply to message #871442] Sun, 13 May 2012 18:35 Go to previous messageGo to next message
Hanz Gunz is currently offline Hanz Gunz
Messages: 8
Registered: April 2012
Junior Member
HOLD ON false alarm: I disabled outbound protection of my firewall (app filtering) and the debug mode worked

...AND the console worked!!!!! saw the magical 'hello world' text. man that felt good lol


google helped me, I did a search on that debug error msg, and came across another forum ('stackoverflow' I think) where someone suggested this was due to firewall settings
it didn't expect it to cause the console bug too, though
in fact I don't see how outbound filtering can affect Eclipse in any way (except automatic update component if there is one) since Eclipse aint no "networking program" Confused but w/e

so anyway it aint a bug at all



really REEEEEEALLY sorry 4 wasting ur time folks Sad ...my bad...mea culpa & all that...

I re-titled the topic


but perhaps this could be of some use to others if they hit some weird bug like that, just switch off their firewalls to test & see what happened Smile

[Updated on: Sun, 13 May 2012 18:40]

Report message to a moderator

Re: /!\ WARNING /!\ CRITICAL bug in Eclipse Java IDE [message #871536 is a reply to message #871464] Mon, 14 May 2012 07:07 Go to previous message
Joop Lanting is currently offline Joop Lanting
Messages: 8
Registered: July 2009
Junior Member
For your information: JAVA 7u4 runs OK on Windows XP.
And why not?

;JOOP!
Previous Topic:How to set the target runtime to a web project programmatically
Next Topic:Alternative to extending an 'internal' class
Goto Forum:
  


Current Time: Thu Jul 24 00:22:13 EDT 2014

Powered by FUDForum. Page generated in 0.03159 seconds