I wrote two java projects which are purely independent.
When I run the first project "aa", automatically a "Run Configurations" window appeared, and I chose "cc" (cc.java) under Java Application tab.
The app run.
but when I made another java project "dd" and wrote code in its class "ff", The run button showed the output of cc.java in console.
I had to go to "Run Configurations", and select "ff" (ff.java) under Java Application tab.
Why I have to to do this everytime?
What if I have multiple classes under one project?
Is there anyway to run a project by simply clicking run button?
Regards,
BAQAR RAZA MANGRANI
Struggling programmer.
As far as I know, if you have several classes including a main method in eclipse, as soon as you run them once, they appear as shortcuts when expanding the run button(or debug). Just click on the small arrow next to the start button and select the file you want to run.
So I've been using Eclipse on my mac for the past 4 months with no problems but suddenly things are acting up. Before, Eclipse would show me a red dot on the lefthand scroll bar when I was working on a class in a project. Now, for some reason, all it does is grey-out that line number but it does not show me that dot like it used to. I've tried restarting both Eclipse and my computer, I've tried working on different projects and classes, I've made sure a project builder is selected, and I've checked that the "show errors" options are all checked. I do not like having to have another window open to see exactly where all my errors are; I preferred just having the red section on my class screen. Any other suggestions?
Thanks everyone!
You could try looking here: Error indicators in file margin in eclipse indigo
Open Preferences, select General/Editors/Text editors/Annotations, and make sure that the errors/warnings are selected to be displayed in the Vertical and Overview rulers.
or
Figured it out, if you go to system preferences > general > click the "when scrolling" button, to only show the scroll bar when scrolling it fixes it. Mine was previously on "always". I restarted eclipse and it shows the errors/warning message etc now.'
I'm trying to follow the Android Development Tutorial - this page: http://developer.android.com/training/basics/firstapp/running-app.html
I am stuck - I cannot run the application. The instructions say "Open one of your project's files and click Run from the toolbar." However, there is no "Run" button on the toolbar, and there is no obvious option to choose from the "Run" dropdown on the menubar (see screenshot below).
Further down on that page, the instructions say "In Eclipse, click Android Virtual Device Manager from the toolbar." That button is also not there!
Am I missing something really obvious? I am on the Java perspective, and I have tried "Window -> Reset Perspective", but I am unable to run the application.
Any help would be appreciated.
EDIT: Under Window -> Customize Perspective -> Menu Visibility, I only have this - ticking Run unfortunately doesn't add anything - nor does ticking Launch under "Toolbar Visibility", when I try that I get the error Launch cannot be made visible because it is in the unavailable null command group. Would you like to switch to the Command Group Availability tab?.
You can add it like Window -> CustomizePerspective -> Menu Visibility -> Run -> Ok
or still can run your project by
Right clicking on your project which you want to run from the project explorer and select Run as and then Android application....T daaa...
If still the problem is there check
The "Run As -> Android Application" is no longer an option in my Eclipse Run Configuration
"Run as" android application is missing
Window -> Customize Perspective -> Toolbar Visibility -> tick Launch -> Press ok
Window -- > Open Perspective --> Java
If the entire toolbar is missing then you can use
Window -> Appearance -> Show Toolbar
Don't modified BuildConfig.java file,that file is generate by android sdk.
You can download android Tutorial video help youself improve.
Update
This was fixed in Eclipse 2018-12. This behaviour is still default, but can be configured off - see the accepted answer for how
I'll leave the question as it was for posterity, and for those on earlier versions of Eclipse
In Eclipse, I've enabled intellisense-style suggestions for Java by going to
Window -> Preferences -> Java/Editor/Content Assist
and setting the following
Auto activation delay (ms) -> 0
Auto activation triggers for Java -> .(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
source = Eclipse Intellisense?
This works brilliantly, apart from one annoying problem. When I hit spacebar, the token being typed is autocompleted with whatever is at the top of the suggestions list. Fair enough, except that sometimes I'll type a class/variable name with an exact legal match, but this won't appear as the top suggestion. So when I naturally hit spacebar Eclipse inserts something completely wrong.
E.G. after typing Cookie I'll hit spacebar and get CookieMonster.
This seems like a bug, and happens often enough to be annoying, but even despite this I don't want spacebar to trigger autocomplete in general. I may want to type a variable name which hasn't been declared yet, or something similar. I want to use autocomplete as a helper tool, but my natural typing should always take priority over it.
I'd like to stop spacebar triggering autocomplete, and either fall back to using enter, or better still trigger autocomplete with a custom key not used in ordinary typing. Is any of this possible?
I've played around with all the settings in Content Assist to no avail. Googling the question just returns a bunch of results about disabling the autocomplete feature.
This issue is fixed from Eclipse 2018-12 [4.10] see the accepted answer
It's present in all prior versions, i.e. 2018-09 [4.9], Photon [4.8], Oxygen [4.7], Neon [4.6], etc..
Eclipse 2018-12 was already patched for this!
A patch for Bug 348857 was recently merged to the Eclipse project and was released as part of Eclipse 2018-12. You can download that version here.
You now have a new option to disable all insertion triggers apart from enter, which will prevent spacebar from causing autocompletion.
Simply go to Preferences... -> Java -> Editor -> Content Assist (or Window -> Preferences -> Java -> Editor -> Content Assist on Windows) and select Disable insertion triggers except 'Enter', as shown in the screenshot below:
There is a solution on the issue tracker for this.
Copy the jar in the eclipse/dropins folder. With the next restart space is diabled as autocompletion trigger.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=348857
Eclipse 12-2018 and newer: This is working natively, check Pyves answer.
Use a SDK version of eclipse
1.open Plug-ins View and find org.eclipse.jface.text, right click, choose import as Source Project. After import, you find it in your workspace.
2.In src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
char[] triggers = t.getTriggerCharacter();
if(contains(triggers,key))
change to
if(key!='='&&key!=0x20&&contains(triggers,key))
3.Export org.eclipse.jface.text
Right click the project folder of org.eclipse.jface.text, choose export-->Deployable plugins and fragments, next, destination choose archive file, finish. Replace the one in eclipse/plugins with the one you generate.
The spacebar has been a key to select the autocomplete even in Indigo. To my knowledge, this can't be configured.
In fact, that is probably why the delay exists.
I suggest setting the delay to some optimal value that allows you to type things like private void ... comfortably without triggering suggestions for private and void. Then in case you get a suggestion because you waited too long, press Escape to abort Content Assist.
Same configuration as davnicwil, same issue, still on eclipse 4.4.
Solution: Intercept (hook) SHIFT+SPACE (press and hold) on (editor-window) eclipse and replace it with ESC,SPACE (sequence). Now you my decide between
Autocomplete+SPACE: press SPACE when autosuggestion present
just SPACE: press predefined key combination or sequence (e.g. SHIFT+SPACE)
On windows you may use http://www.heise.de/download/activaid.html (you can also use AutoHotkey, java native hook, ...)
HowTo with ActivAid:
Open Ac'tivAid, select "UserHotkeys"
click on "+", set a description
click on "short cut", press e.g. SHIFT+SPACE
Command: "{ESC}{SPACE}" (without quotes)
click "+", select eclipse editor frame, press ENTER
click OK, OK in Ac'tivAid
My config file:activAid/settings/ac'tivAid.ini:[UserHotkeys]
Hotkey11=+Space
Path11=<Send>{ESC}{SPACE}
Description11=Eclipse Shift+Space -> Esc,Space
Category11=
Application11=ahk_class SWT_Window0
You may also remap keys on non-english keyboards with "HotStrings", e.g. ö->{,ä->} etc.
Finally worked it out.
Try download this org.eclipse.jface.text.jar and copy it to your plugin folder(Typically eclipse/plugin). Do not forget to backup your own one.
Works on Eclipse Juno.
If the link doesn't work, comment on this, thanks.
In Eclipse go to Window -> Preferences -> General -> Keys and remove the binding for the command Content Assist.
You could disable Auto activation via the check box in
Window -> Preferences -> Java/Editor/Content Assist
and activate the auto-complete feature on demand. The default hotkey for this is
CTRL+Space
Hey there - just wondering if anyone knows the trick to getting icons to display on button in a JApplet. When I add the icon from a png in my package via the properties panel it turns up in the NetBeans IDE as expected but when I run the launch file it isn't there. I can confirm that the file exists in my Jar and no exceptions seem to be thrown in relation to missing files.
If I create a similar application using a JForm and run it directly from NetBeans the icon appears as expected.
EDIT:
It seems this is confined to Chrome... works correctly in IE9 and FF 3.6
EDIT:
Replicate as follows - no coding required:
Create a NetBeans 6.9.1 Project with the following settings:
Java --> JavaApplication
[Next>]
Name e.g. JavaApplication1
Untick "Create Main Class"
[Finish]
Add a png image "MyIcon" to the src directory.
Right Click "JavaApplication1" Project in Projects panel and select New -> JApplet Form
[Finish]
Drag a button onto the form, right click -> properties -> icon and choose "MyIcon" from the pre-populated dropdown menu. You should see the icon appear on the button in the IDE.
Build the project, then navigate via explorer to the dist/launch.html file and run it in Firefox or IE and the icon will be there, run it an Chrome 10 and it won't.
It seems this problem magically went away and now I wish I had noted the exact version of Chrome that I had so that I could tell whether it updated or not. I worked around the problem but inadvertently left an icon on a button - I started work again today on my project and how-you-doing there was a lonely icon on a button - there are three possible reasons why this happened:
1 - I shut down my machine overnight; aka restart (93% Sure this was it)
2 - I moved the entire Netbeans project to another directory (5% Sure this was it)
3 - maybe but unlikely Chrome updated itself with a fix (2% Sure this was it)