Eclipse - Source not found when trying to open declaration of random() [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I know a lot of similar questions have been asked, but I didn't find what I wanted in any of the questions. I am a beginner, don't know much about anything.
double x = Math.random();
System.out.println(x);
When I press my Ctrl key and press 'Math' keyword it shows source not found, even when I try to open the declaration and implementation of Random, it shows the same error.
Actual-
Expected-
My compiler settings

In Eclipse, go to window->preferences->java->installed JRE's. Then double click on the one you are using and navigate to the source location and link to the src.zip that should come with your JDK. You should see a window that looks something like the following: (Note that this is where you would configure the source location and the JavaDoc for the API).

Related

Is it is possible to mark code in IntelliJ? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I'm currently still learning the basics of Java and I have dozens of exercises, many times I have trouble finishing them and I'm forced to either ask for help or copy the answers from Github. I want to be able to mark the code I didn't write myself so I can focus on what I have trouble with. I've only found something like that for Visual Studio Code. Thanks in advance.
You can use Bookmarks in Intelij to "save" a place in your code and revisit them later.
Furthermore, you can use Shift+Ctrl+NUMBER to toggle the bookmark for the given NUMBER and you can goto that bookmark with Ctrl+NUMBER.
You can either use bookmarks or yur could use comments to add some text of what you understand and what not.

What is the shortcut for find variable not used In Netbeans? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Does anyone know how to find some variables not used in Netbeans, like when I create the variable String a and I hover over that variable I get the info Variable "a" is not used?
I want to jump into that variable because in my servlet there are too many lines.
I'm not aware of any functionality that comes out of the box. But some third party tools offer you what you are searching for:
PMD (especially this rule). There's also a NetBeans plugin although I don't know if it works with the newest version of NetBeans.
SpotBugs (search for unused in the documentation to find the rules)

eclipse import cannot be resolved [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have an existing Java project and I open it in eclipse.
Now I add a new package in it, and I create java files and write code in the new package.
However, when I try to import class from other existing packages, I failed.
Why?
Almost no info but I think that I know what happens:
Must be that the previous project's code is not in a source folder, instead I think that it's on a normal folder...
Look at Project -> Properties -> Java Build Path -> Source
A parent folder(s) of yoursource code folder(s) must be there.
If whit so little info I've help you to fix your problem you owe me a pizza.

Print list of all Eclipse quick fix suggestions for the active project [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to write a piece of Java code to call Eclipse quick fix and print all its suggestions in the console.
As an example, if I have a reference to an undefined variable, then the compiler error will be cannot be resolved to a variable. In this case, Eclipse suggestes some fixes such as Create Local Variable, Create Field, or Create Parameter. In my project I want to print this three suggestions as output.
I saw this page, but not useful.
Please let me know what is the best way to do this task.
The solution is to extend org.eclipse.jdt.ui.quickFixProcessors plug-in, and also extends IJavaCompletionProposal interface.
This web page describes all details that you need. It is in Germany, but I am sure you can use Google translator to have it is English. Hope, it helps.

Where can I find source code for tutorials on developer.android.com site? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I just started learning android and work on second class Adding the action bar.
I followed this tutorial and I see that some files are missing and I have errors on my project.
Is there a place where I can fetch source code for this and other tutorials on developer.android.com.
I searched the site but found no reference where sources can be.
Thank you!
Check and import from this path of your own computer.
D:\adt-bundle-windows-x86_64-20130522\sdk\samples
i.e go into your sdk -> samples ...
Everything is inside this..

Categories