Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse doesn't show arguments names in code assist(in JDK libraries only)
icon5.gif  Eclipse doesn't show arguments names in code assist [message #653527] Thu, 10 February 2011 06:55 Go to next message
Konstantin  is currently offline Konstantin Friend
Messages: 7
Registered: February 2011
Junior Member
Hi,
I've got a strange problem with Eclipse.
When I type some methods from JDK classes, eclips shows the names of the arguments like this: arg1, arg2, arg3 .. etc.
http://img163.imageshack.us/img163/9629/20110210112446.th.jpg

But I want it to show the real names, e.g. like FlashDevelop
http://img545.imageshack.us/img545/2320/20110210112906.th.jpg

Is it possible?
Re: Eclipse doesn't show arguments names in code assist [message #653561 is a reply to message #653527] Thu, 10 February 2011 09:26 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 10.02.2011 07:55, Konstantin wrote:
> Hi, I've got a strange problem with Eclipse. When I type some methods
> from JDK classes, eclips shows the names of the arguments like this:
> arg1, arg2, arg3 .. etc.
> http://img163.imageshack.us/i/20110210112446.jpg/
Do the Javadoc hovers work? Do you have source and/or Javadoc attached
to the rt.jar?

Dani
>
> But I want it to show the real names, e.g. like FlashDevelop
> http://img545.imageshack.us/i/20110210112906.jpg/
>
> Is it possible?
Re: Eclipse doesn't show arguments names in code assist [message #653627 is a reply to message #653527] Thu, 10 February 2011 13:27 Go to previous messageGo to next message
Konstantin  is currently offline Konstantin Friend
Messages: 7
Registered: February 2011
Junior Member
Quote:
Do the Javadoc hovers work?

Yes, if you're talking about this:
http://img233.imageshack.us/img233/3671/20110210192149.jpg

Quote:
Do you have source and/or Javadoc attached
to the rt.jar?

I guess not. How can I do it?
Re: Eclipse doesn't show arguments names in code assist [message #653645 is a reply to message #653627] Thu, 10 February 2011 14:16 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 10.02.2011 14:27, Konstantin wrote:
> Quote:
>> Do the Javadoc hovers work?
>
> Yes, if you're talking about this:
> http://img233.imageshack.us/i/20110210192149.jpg/
>
> Quote:
>> Do you have source and/or Javadoc attached to the rt.jar?
>
> I guess not. How can I do it?
You have at least one or the other attached, otherwise you wouldn't get
a Javadoc hover. Therefore you should also get the parameter names. One
reason why you're not getting them could be a slow connection and hence
the timeout is reached. In that case I suggest to download source and/or
Javadoc locally and attach it. If that's not an option, try to increase
the timeout (Java > Editor > Content Assist > Advanced preference page).

To attach source or Javadoc, select the 'rt.jar' in the Package Explorer
and then File > Properties.

Dani

Dani
Re: Eclipse doesn't show arguments names in code assist [message #653652 is a reply to message #653527] Thu, 10 February 2011 14:48 Go to previous messageGo to next message
Konstantin  is currently offline Konstantin Friend
Messages: 7
Registered: February 2011
Junior Member
Thanks, Dani. Now I know why this happens, and it looks like a progress already. I've increased the timeout to 300 milliseconds and now it shows the correct argument names when there's an Internet connection. But as to javadoc download, it seems like I'm stuck. Can I download javadoc alone? Google led me to this page http://www.oracle.com/technetwork/java/javase/documentation/ index-jsp-135444.html
which says "It can be downloaded only as part of the Java 2 SDK" but I need javadoc only

[Updated on: Thu, 10 February 2011 14:48]

Report message to a moderator

Re: Eclipse doesn't show arguments names in code assist [message #653661 is a reply to message #653652] Thu, 10 February 2011 15:08 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 10-Feb-11 07:48, Konstantin wrote:
> Thanks, Dani. Now I know why this happens, and looks like a progress
> already. I've increased the timeout to 300 milliseconds and now it shows
> the correct argument names when there's an Internet connection. But as
> to javadoc download, it seems like I'm stuck. Can I download javadoc
> alone? Google led me to this page
> http://www.oracle.com/technetwork/java/javase/documentation/ index-jsp-135444.html
> which says "It can be downloaded only as part of the Java 2 SDK" but I
> need javadoc only

Right, not the "Javadoc tool".

We're talking about the Javadoc associated with JARs you consume. If you
installed a proper Sun JDK, then it came with Javadoc for all the
ordinary Java packages.

For third-party libraries, you sometimes have to work a little bit. You
download and use the binary (.jar), but you frequently have to hook it
up to its Javadoc or source code, whichever came along with the download.

Typically, when you download a third-party JAR, it will come with lots
more stuff than just the library. That's what Daniel was talking about
when he suggested you right-click on the JAR and choose Properties.

Try it on one of the libraries for which you're not getting Javadoc. You
browse to find that Javadoc in the download. Usually, you choose the
parent directory and it's sometimes called "doc", "javadoc", etc.

Some downloads, such as more of the Apache Commons libraries, come with
JARs that themselves contain Javadoc and you see it in their names.
That's when, in that same Properties dialog, you choose Javadoc in
archive and then go find the Javadoc JAR.

Hope this gets you running.
Re: Eclipse doesn't show arguments names in code assist [message #653858 is a reply to message #653527] Fri, 11 February 2011 15:27 Go to previous messageGo to next message
Konstantin  is currently offline Konstantin Friend
Messages: 7
Registered: February 2011
Junior Member
That's not exactly what the situation is. I didn't download any third-party libraries. I use only standard JDK which I had downloaded from oracle.
But If I create some custom classes' instances, I can see the real names of all arguments of their constructors and other methods.

This doesn't work for standard classes only.
I had even removed this JDK and installed it anew. Vainly.
Re: Eclipse doesn't show arguments names in code assist [message #653863 is a reply to message #653858] Fri, 11 February 2011 15:42 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 11-Feb-11 08:27, Konstantin wrote:
> That's not exactly what the situation is. I didn't download any
> third-party libraries. I use only standard JDK which I had downloaded
> from oracle. But If I create some custom classes' instances, I can see
> the real names of all arguments of their constructors and other methods.
> This doesn't work for standard classes only.
> I had even removed this JDK and installed it anew. Vainly.

So, it's only for standard Java classes that Javadoc doesn't work?

You installed an actual JDK, right? Not simply a JRE? As long as I
download a JDK, I never fail to have access to Javadoc for every
standard Java interface (java.util, java.io, java.lang, etc., the list
is quite long).

Hmmmm... I've not experienced this problem. Perhaps someone else will
see through this when they read this thread.

Of course, when you create a custom class, you've got access to that
class in the project in which you created it since the source code is there.
Re: Eclipse doesn't show arguments names in code assist [message #653865 is a reply to message #653863] Fri, 11 February 2011 15:50 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On Fri, 2011-02-11 at 08:42 -0700, Russell Bateman wrote:
> On 11-Feb-11 08:27, Konstantin wrote:
> > That's not exactly what the situation is. I didn't download any
> > third-party libraries. I use only standard JDK which I had downloaded
> > from oracle. But If I create some custom classes' instances, I can see
> > the real names of all arguments of their constructors and other methods..
> > This doesn't work for standard classes only.
> > I had even removed this JDK and installed it anew. Vainly.
>
> So, it's only for standard Java classes that Javadoc doesn't work?
>
> You installed an actual JDK, right? Not simply a JRE? As long as I
> download a JDK, I never fail to have access to Javadoc for every
> standard Java interface (java.util, java.io, java.lang, etc., the list
> is quite long).
>
> Hmmmm... I've not experienced this problem. Perhaps someone else will
> see through this when they read this thread.
>
> Of course, when you create a custom class, you've got access to that
> class in the project in which you created it since the source code is there.

Be sure to install the source jar file along with the JDK. Then do what
Daniel said in his last post to associate the source with the JDK.
Eclipse will parse out the arguments and JavaDoc from the attached
source without having to go across the internet.
Re: Eclipse doesn't show arguments names in code assist [message #653876 is a reply to message #653863] Fri, 11 February 2011 16:41 Go to previous messageGo to next message
Konstantin  is currently offline Konstantin Friend
Messages: 7
Registered: February 2011
Junior Member
Russell Bateman wrote on Fri, 11 February 2011 10:42

So, it's only for standard Java classes that Javadoc doesn't work?


Yes Smile As far as I know. Because I tested only the standard and custom classes, that I wrote myself
Quote:

You installed an actual JDK, right? Not simply a JRE?
.


Yeah. I've got an environment variable Path set as well: C:\Program Files\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%; %SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowe rShell\v1.0\;C:\Program Files\e\cmd;C:\Program Files\QuickTime\QTSystem\;C:\Java\jdk1.6.0_20\bin

I think the project wouldn't even compile without JDK, would it?

Quote:
Be sure to install the source jar file along with the JDK


It might be a stupid question, but where do I get it?
Maybe I'm making some wrong queries, but I can't seem to google it out

The installation instruction from oracle doesn't give any info on this matter either

Could you give me a link where I can doenload this file, please? Rolling Eyes

[Updated on: Fri, 11 February 2011 16:44]

Report message to a moderator

Re: Eclipse doesn't show arguments names in code assist [message #654238 is a reply to message #653876] Mon, 14 February 2011 17:01 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 2/11/11 11:41 AM, Konstantin wrote:
> Russell Bateman wrote on Fri, 11 February 2011 10:42
>> So, it's only for standard Java classes that Javadoc doesn't work?
>
> Yes :)
> Quote:
>> You installed an actual JDK, right? Not simply a JRE? .
>
>
> Yeah. I've got an environment variable Path set as well: C:\Program
> Files\NVIDIA
> Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;
> %SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowe
> rShell\v1.0\;C:\Program Files\e\cmd;C:\Program
> Files\QuickTime\QTSystem\;C:\Java\jdk1.6.0_20\bin
>
> I think the project wouldn't even compile without JDK, would it?
> Quote:
>> Be sure to install the source jar file along with the JDK
>
>
> I might be a stupid question, but where do I get it? Maybe I'm making
> some wrong queries, but I can't seem to google it out :roll:
> The installation instruction from
> http://www.oracle.com/technetwork/java/javase/documentation/ install-windows-152927.html
> doesn't give any info on this matter
>
> Could you give me a link where I can doenload this file, please? :roll:

I doubt you can download the source separately. But when you install the
JDK (not the JRE, make sure you're getting the JDK), there's an option
during the installation to include the source or not. At least, there
used to be; I haven't installed on Windows in a couple of years, not
since Oracle took over, so there's a chance it has changed)

Here's the page to get the JDK from:
http://www.oracle.com/technetwork/java/javase/downloads/inde x.html

Eric
Re: Eclipse doesn't show arguments names in code assist [message #655344 is a reply to message #653527] Sat, 19 February 2011 16:46 Go to previous messageGo to next message
Konstantin  is currently offline Konstantin Friend
Messages: 7
Registered: February 2011
Junior Member
Now, I've apparently attached javadoc to my project, but nothing changed. Sad
http://i034.radikal.ru/1102/83/2fec01a6e48et.jpg

If I click Validate, I get the following error:
http://s46.radikal.ru/i114/1102/24/baed17afc3fet.jpg

What am I doing wrong? How can I make javadoc create thos documents? I just can't understand it


It's getting relly annoying. One of the best IDE's can't do such a trivial thing as showing parameter names automatically...

[Updated on: Sat, 19 February 2011 16:51]

Report message to a moderator

Re: Eclipse doesn't show arguments names in code assist [message #655361 is a reply to message #655344] Sat, 19 February 2011 21:57 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
Did you validate the javadoc when you added it ?
You might have a root inside the zip you attached. You need to specify a path when you attach the javadoc to know where to look for the javadoc inside the zip file.

HTH,
Olivier
Re: Eclipse doesn't show arguments names in code assist [message #655372 is a reply to message #653527] Sun, 20 February 2011 04:57 Go to previous messageGo to next message
Konstantin  is currently offline Konstantin Friend
Messages: 7
Registered: February 2011
Junior Member
What zip archive? I didn't attach zip, I just added a path to javadoc.exe which is a part of JDK.
Here it is:
http://s58.radikal.ru/i160/1102/f2/926995e4204bt.jpg


Well, I've just found out that netbeans can do it without attaching any javadocs or sources, so I'll better use netbeans.
Thanks to all who tried to help Smile

[Updated on: Sun, 20 February 2011 05:04]

Report message to a moderator

Re: Eclipse doesn't show arguments names in code assist [message #655374 is a reply to message #655344] Sun, 20 February 2011 05:04 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On Sat, 2011-02-19 at 11:46 -0500, Konstantin wrote:
> Now, I've apparently attached javadoc to my project, but nothing changed. :(
> http://radikal.ru/F/i034.radikal.ru/1102/83/2fec01a6e48e.jpg .html
>
You don't attach JDK JavaDoc to your project. Project JavaDoc is for
your code, not the JDK code. You need to attach the JDK doc to the JRE
entry in Windows->Preferences->Java->Installed JREs.

However, I don't think that this will give you what your looking for in
content assist. This will only provide Java Doc.

Your best bet is to use the source code. Re-install the JDK. Make sure
you select install source from the installation dialog. This will place
the src.zip file in the JDK directory.

Now, go back to the Windows-Preferences->Java->Installed JREs. Click on
Add and navigate to the directory where you installed the JDK. Eclipse
should automatically pick up the src.zip file and associate it with all
the jar files for the jdk.

Save and make this JDK the default for the workspace.

Check the options under Windows->Preferences->Java->Editor->Content
Assist to adjust how content assist lists proposals.

You should now have content assist with argument names and Java Doc.

> If I click Validate, I get the following error:
> http://radikal.ru/F/s46.radikal.ru/i114/1102/24/baed17afc3fe .jpg.html
>
> What am I doing wrong?
> It's getting relly annoying. One of the best IDE's can't do such a trivial thing as showing attribute names automatically...
Previous Topic:Eclipse memory allocation problem
Next Topic:Creating workbench from existing workbench
Goto Forum:
  


Current Time: Fri Mar 29 02:27:48 GMT 2024

Powered by FUDForum. Page generated in 0.04570 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top