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.
Related
Whenever I hit Debug or Run in Eclipse, I get a dialog asking me what configuration I want to use.
How do I set a default configuration and bind a keyboard shortcut?
Maybe this article from Eclipse One Tips will help you:
How to run the last launched application
The answer lies in a preference hidden on the Run/Debug page:
Go to Window > Preferences > Run/Debug > Launching.
Select the option Always launch the previously launched application. It’s located at the bottom of the dialog.
The preference should look something like this:
Now you’re free to press
F11, Ctrl+F11 or click the Run/Debug
icons on the toolbar with confidence, knowing it’s going to run what
you expect it to run.
One question arises: How do you quickly run a class as a specific
application (eg. a JUnit test) if you can’t press F11 to
run it? You have some options available:
The fastest way is to use keyboard shortcuts. Eclipse allows you to launch classes using a keystroke, including JUnit tests, Java
applications, etc using Alt+Shift+X.
Alternatively, right-click on the class and select Run As. The submenu will show available options for launching the class.
Lastly, you could click the pulldown arrow on the run/debug icons in the toolbar and select Run As. The submenu once again shows
available options for launching the class.
Eclipse plug-ins that add new project types may contribute 'Launch Configurations' to control how Eclipse executes the application. For example, J2EE based projects need to publish content and start the application server. Contrast this with simply starting a JVM for a regular Java application.
When you select a configuration, Eclipse records this for future use. You can access these by selecting the 'Run/Run Configurations' menu item or selecting 'Run Configurations' from the little drop down menu next to the run and debug toolbar buttons. You can also add new launch configurations through the Run/Debug Configurations dialog that opens. In this dialog, you should see one or more configurations that you previously launched. Selecting one reveals all the info Eclipse uses to launch your application. One tab called 'Common' contains options for controlling the your favorites menu. Checking the box next to Run or Debug will add this launch configuration to the top of its corresponding menu.
If you only have a single configuration in your menu then Eclipse will launch it when you click the associated button. If you have more than one then Eclipse launches (sometimes) the most recently used. I say sometimes because, occasionally, one launch configuration causes another to launch, which cause the last used configuration to be the second one when you would expect it to be the first one. Usually this happens to me when I launch an application, which needs to be built and the build launches a tool. When this happens, just select the correct launch configuration from the drop down menu.
You can bind a keystroke combination to the Run and Debug commands through the 'Windows/Preferences' menu item. Then select 'General/Keys' in the tree control on the left.
Each time I try to run a new program, an old program 'client.java' is run by eclipse. How do I change this setting? How do we tell eclipse which program to run? I tried using the arrow beside run button but it dosen't list out my new program.
You can change the default behavior by going to Window > Preferences > Run/Debug > Launching and in the 'Launch Operation' section, select the radio button for Launch the selected resource or active editor and then select Launch the associated project underneath.
Right Click To the class -> Run As-> JAVA Application
Firs of all make sure that your program has a main class.
Then click in the black button next to the run button -> Run As-> JAVA Application.
If this doesn work make sure you have all this properly set up.
Run Configurations
In Eclipse, running a project is as simple as clicking the run button.
In NetBeans, I'm totally confused. How do I run the program? If I print something, where does it go (e.g. the console in Eclipse)?
Thanks!
EDIT: Solved it. For some reason it was running a different application than the one I had selected. Anyone know why?
It's the same in NetBeans, just klick the "Run" button (you need to have a main class defined though)
The output goes into the "Output" window which is displayed at the bottom of the editor by default.
If you don't see the output window, you can display it using the menu "Window -> Output -> Output"
In the menu, see Run > Run to run a project.
On the bottom right, find the output windows, that's where the print will appear.
How can I create a RCP application, which looks exactly like the Eclipse IDE with all menus, views, dialogs...?
Here is one example: http://richclientplatform.blogspot.com/2007/12/oil-and-gas-industry-using-eclipse.html
I followed Lars Vogel's tutorial to create a simple RCP application: http://www.vogella.de/articles/EclipseRCP/article.html.
... what are the next steps?
The ide bundle provides you with classes and extension points that allow you to use the workspace metaphor but it does not include the extensions that add all the functionality that you would see in the Eclipse IDE.
Since each bundle in an RCP app application adds menu, views, and dialogs the way to get your application to look like the IDE is to include all of the bundle that come with the IDE.
Usually you start with a pretty bare application like something tutorials that Vogel (who I find puts out good tutorials) puts out describe. Then when you find something that you want to add you research which bundle provides it and you add that bundle. As you do this your application will grow in functionality without picking up functionality your user does not need.
EDIT: Let me walk you through creating a simple RCP application.
Create a new Project by going to File -> New -> Project
Select Plug-in Project
Set the Project name to com.mydomain.rcp
Click Next
Under Rich Client Application select Yes
Click Next
Select RCP Mail Template
Click Finish
You now have an RCP app with some functionality. Next we will run it:
Select Run -> Run Configurations...
Select Eclipse Application on the left
Right click and select New
Look for Program to Run/Run a Product. Select com.mydomain.rcp.product
Click on the Plug-ins tab
Find Launch with at the top and select plug-ins selected below only
Click Deselect All on the right
In you list of plug-ins select com.mydomain.rcp
At the bottom de-select Add new workspace plug-ins to this launch configuration automatically
On the right click on Add Required Plug-ins
On the bottom click on Run
The application should be running the sample mail application. Go ahead and close it down. Now let's add a plugin so we can get the Search menu to show up like it does in the Eclipse IDE.
In your com.mydomain.rcp project open up your plugin.xml file
Click on the Dependencies tab
Under Required Plug-ins click Add...
Type in org.eclipse.search
Select org.eclipse.search (not the source one)
Click OK
Save the plugin.xml file
From the menu select Run -> Run Configurations...
Click on the Plug-ins tab
On the right click on Add Required Plug-ins
On the bottom click on Run
You should now see the Search menu with the File Search option just like the IDE has. You will not see the Java Search or the Plug-in Search though because we did not add the appropriate JDT or PDE plugins containing those additions. Hopefully this gives you an idea how to add new plugins.
I have an Eclipse project where I often launch the same java class. I have added my run configuration to the favorites menu, but to launch it I still need to click on the run-drop-down menu and click the icon - is there any way to associate a shortcut to this? When I searched for it I got lost in all the plugins & other things which seemed to be not so simple.
edit: Let me clarify, I want something I can type the moment I start eclipse, regardless of what page I'm viewing, so no "run last" or "run current"; I want F12 to link to "launch foo.bar.MainClass".
Just use Ctrl + F11. (This is the standard keyboard shortcut to run the class you are working on)
I wish this is what you are looking for... buddy.
Open the workspace preferences by the menu: Window > Preferences
Select from the tree: Run/Debug > Launching
Now the Launching preferences are seen.
At the bottom there is Launch Operation
Use the option Always launch the previously launched application
You can configure your launch behaviour so Ctrl-F11 will launch the last launched application again, regardless of your current editor selection.
Look at "Run/Debug" - "Launching" within the eclipse preferences.
alt+shift+x+J Rocks
You can go Window -> Preferences -> General -> Key and bind anything you want!I hope it helps!
You should put in a feature request in the eclipse bug tracker (or vote up an existing equivalent feature request) or code it yourself.
It is Ctrl+F11
Ctrl+Shift+X or Ctrl+Shift+J didn't worked for me!
If you've added these classes to your favorite run configurations (available from the run/debug toolbar buttons as "Organize Favorites..."), then the shortcut key combo is Alt+R,T,1 to run your first favorite, Alt+R,T,2 to run your second, etc. Alt+R,H,# works for debug configs.
on Windows machine
ctrl+Fn F11 --- running
ctrl+Fn+Shift F11 --- debugging
If you are someone like me who wants to create a shortcut to run a class/program in java directly, you can create your own preferable shortcut in ECLIPSE!
Follow these steps:
Window > Preferences > General > Keys
Select run from command column
Enter your own shortcut in Binding section
Apply and close!!
WARNING: Make sure you don't create a shortcut which is already assigned for a different task!
I cannot this the answer here but : CTRL+SHIFT+T do apparently exactly what you want! :) Maybe it's because you code it by yourself by time...
Watch here: http://eclipse.dzone.com/news/effective-eclipse-shortcut-key for more.
I faced this problem in eclipse too. I have customized the configuration for me.
Windows -> preferances -> keys
Search for your configuration eg "Run Java Application" or just look for its icon.
Select it
and below in the binding field press keyboard keys which you want to add a shortcut for this configuration eg. ctrl + shift + T
and Apply
You are good to go use the same shortcut keys to whenever you need it.
Just create an "External tool configuration" instead of a standard configuration for the class you want to run, and assign a shortcut key to "Run last launched external Tool".
Of course, there shall be no other external tool configuration.
Even if other java programs have been launched, or the current class contains a main() method, hitting the shortcut key will always run the same configured class.