I used the Maven archetype maven-archetype-quickstart at the command-line to generate a new project. I imported that project into IntelliJ 2017.1.
How do I run the app?
How to debug the app?
The green triangle button to run the app is disabled.
I opened the panel listing Maven lifecycle and plugins. But I do not see any action for running the app.
When running the application itself, within IntelliJ, you will have to open the App.java-file in order to run it. From there, right-click and select Run within the static main()-method. In the same context-menu, you also have to option to select Debug.
Running the application from Maven is however not possible based on the archtype. Maven may rather help you package the entire thing. However, executing the jar-file post-build is quite simple - as explained in the documentation found here:
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
Related
I have cloned a Bitbucket project in my Eclipse IDE and I want to debug the project as a remote application.
However, in the debug window (->connect window), the project name is not shown.
Why do I not see it?
I am Attaching Screenshots where you create Debug Configurations for any Remote Java application.
Lets Go step by step:
Within Debug Configuration Window
You right click Remote Java Application > New
In the Connect Tab you browse the project in your Workspace (One you want to debug), Here in my case it is MyApplication
In Source tab You Find below details where you add any dependent projects with the project that you want to debug
When you say Add here, small dialog box comes up and here you can again choose Java Project, that would be one from your workspace.
I think doing this you would find your Project for Remote Debugging.
Hope this helps..!
I didn't see your problems related screenshots, but according to the situation you described, you can try the following method:
On the debugging of threads Right click it
--select Edit Source Lookup Path
--Select Add
--Select the Java Project
--choose the Java Project you worked with then click OK.
The other situation I think about is whether or not you don't have the jar that you're relying on for the project you downloaded
I had same problem. I had imported project as import project from file system. so it was not java or maven project for eclipse i guess.
i just did import as git project and tried again and it worked.
I'm new to IntelliJ IDEA and I would like to run a simple Maven Quickstart project using it.
I followed all the instructions, the project was sucessfully built. But when I try to compile and run it , the Run button is not activated.
It looks like IntelliJ IDEA couldn't figure out where the main class is.
This is a picture of the project's hierarchy.
What is the problem ? And how can I fix it ?
Thanks !
Refresh the Maven project in the Maven Projects tool window (Reimport All Maven Projects), if it doesn't help, refer to this answer for diagnostics.
The issue is that your source roots were not configured correctly from the Maven model for some reason and the .java file appears in a plain directory instead of the Source root.
You can tell that by the color of the folders and by the icon of the file.
You need to create a Java Project.
File->New->Project->Java->Next->Next->Finish
Then go to the top and do:
Right click parent folder of project->Add Framework Support->Click Maven->Ok
Now Maven should be added to your project and also you should be able to run it
If this doesn't allow you to run the project, click the little drop down box to the left of the grayed out run button and click Edit Configurations.
Then click the + and click Application and set your Main class to the class that has the main method in it, and then it should allow you to run the application.
Hope that helps!
Seems like your java directory is not marked as Source root. Right click on it and click Mark directory as -> Source root
Have you imported the project as a maven projet ?
If yes, click on the body of your fonction and then do CTRL+MAJ+F10 or MAJ+F10
My issue was that I was looking for the equivalent of calling "mvnw" from the console/terminal.
.mnvw (linux) OR mvnw (windows)
I didn't know where this was in IntelliJ. That's how I interpret part of the question that was asked.
The solution wasn't obvious to me so I wanted to share it.
Conceptually, you want to run the default maven configuration (not a specific lifecycle stage). Therefore you need to select the root entry in the Maven panel:
Then you can play the green play button on the panel:
Alternatively, you can right click and run the maven build from the context menu.
If maven not visible top-right side then maven plugins not avaiable in your intellij IDE.
Follow below steps:
click settings icon(top-right side)->select plugin->click on checkbox at maven option->click apply button then ok button.
After few minutes maven able to see in you IDE.
You need to add to project e.g. Jetty or Tomcat (compile to WAR & run Tomcat server with this war).
If you will have Jetty maven plugin you will be able to run app via mvn jetty:run (Add this to Maven run configuration)
I'm working with Ligdx, an API for cross plattaform game development that by default generates at least 2 projects:
The core project: This is the one you are supposed to work on, where all the classes and logic should be placed.
The desktop project: This one is automatically generated from the core project.
The core doesn't have any class to start it because it's supposed to be started from the desktop (or other platforms) project.
It is also always selected -because its what you are working on- so pressing the "run" or "debug" buttons will attempt to run the core project and not the desktop one and immediately fail thus forcing you to select the desktop project before hitting run/debug. This can get extremely annoying, especially when debugging.
So is there a way to force Eclipse to always run the desktop project?
Rekaszeru's answer to this question shows how to set up Eclipse in order to always launch the previously launched application.
You simply have to go to preferences / run-debug / launching and check the "Always launch previously launched application" box as he shown in the picture he used to illustrate his answer:
This will not force one of the projects to always be launched but it would pretty much solve the problem unless you are working on multiple projects at the same time or you alternate between Web/Android/Desktop.
If Your asking how to start a Core project from already existing project present in the eclipse then all you need to do is Right Click on desktop folder of the project and go over Run As and select Java Application
But if that is not what you have posted for I can only understand that you need to understand how a LibGDX project is deployed.... From Desktop project "In xyzMain.java" file you will have a method call to the core project saying:
new LwjglApplication(new Sample(), cfg);
This is where you'r Sample Class from the core project is called over.
But from the title I get a diff feeling that you wish to add another project to your already existing project...
You can do that by changing the build Path of the project....by including Other proj to the one you wish to compile and run.
Hope this helped you out..
I´m not aware of doing exactly what you have described, but I´d suggest using the Launch Configurations menus and dialgos to do what you want in a similar quick way.
Note that you can configure your launch configurations doing: Run -> Run Configurations... (also Run -> Debug configurations...)
Option 1).
Once you have run your Desktop Project, simply use the Run Drop-down button, which contain your launch configurations:
Option 2).
Save a launch configuration file in your Core project (or wherever you want) using the last "common" tab of the launch configuration dialog:
Then you can simply right-click on your that file to launch your Desktop Project:
P.S: I´d also suggest reading a little bit about run configurations in lars tutorial
I exported my eclipse plugin through the "Export Wizard" in the manifest and seems like everything went well (no errors). It created a .jar file within a plugin directory in a zip file.
I thought putting the jar into my Eclipse plugin directory would install it (after re-launching eclipse) but that didn't work. Eclipse can't see the plugin (the perspective isn't showing up)
I tried with Help->Install new software->local archive but it keeps saying "no software found"
Can you help me getting my plugin ready to be installed on a fresh Eclipse copy?
Ps. my plugin uses other dependencies like EMF/GMF
In eclipse, go to your console window. From the drop down meny, select OSGI console. Run the command ss or ss <name of your plugin>
You will then see the state of your plugin and a number. The state will probably be "installed" which means if has been found, but some dependencies were not satisfied.
Run the command diag <number of your plugin> and you will see why it wasn't started.
For more details, see Wheres my bundle
Edit: A first step to verify that the plugin is working would be to start up a new eclipse instance with your plugin. In the run configuration dialog, there is a tab with all the plugins that should be started. Make sure yours is checked and it will start with the new eclipse instance.
If you are using Eclipse 3.4 or above, put your plugin in the 'dropins' directory.
To install via Help->Install new software you need to create an 'Update site' or a 'p2 repository'.
By far the most ellaborate descriptions of installing your plugin is provided by Vogella deployment of your plug-in
It covers all 3 possible ways in which you may install your plugin detailing the pros & cons of each of the following approaches :
1 . Installing your plug-in from your Eclipse IDE
2 . Export plug-in and put into dropins folder
3 . Create update site for your plug-in
Sometimes you just have to restart Eclipse. File -> Restart and try again. Worked for me because Eclipse was caching the results of my local update site.
Open plugin.xml
In "Overview" Tab in "Exporting section" go to "Export Wizard"
In "Export" window in "Destination" section choose "Install into host. Repository" and choose dir which will looks like "xxx/.metadata/.plugins/org.eclipse.pde.core/install/"
Press "Finish" button
Wait for Export to finish without any problems
Restart Eclipse
I'm currently writing a GWT application through Eclipse. Eclipse is used for development but I use the m2eclipse plugin and a Maven pom.xml with the GWT plugin to build & run it.
When I need to debug the app I must:
Invoke "Run As ..." on a Maven project (via m2eclipse) "war:exploded gwt:debug". This launches GWT's app server and waits for a remote debug connection on port 3408. The need to wait for the WAR to be exploded means it could be a minute for this to happen.
Invoke "Debug As..." a Remote Java Application to connect to the server.
I've already added both targets to favourites to lock them into the drop down but it's still a pain.
I'd like to launch them both in sequence from a single click rather than two discrete actions.
Is there any way in Eclipse to achieve this?
Try this plugin. http://marketplace.eclipse.org/content/escripts
You can define scripts of Eclipse actions easily. You create a script of starting the 2 debug session, then run with one click or shortcut.
EDIT:
The plugin was moved and is now called EASE.
https://eclipse.org/ease/
"Launch Groups" are part of the CDT. Officially supported, easy to install.
See https://stackoverflow.com/a/11905444/518491
Why are you launching like this? Can't you just launch it by GWT plugin? Go to Run Configurations -> Web Application (the blue circle with "g" inside) and create new Run Configuration.
In it, in Main tab, enter (or select) your project, and enter com.google.gwt.dev.DevMode in Main class.
In Arguments enter -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -port 8888 -war path_to_your_dir_with_WEB-INF_directory com.package.your.Module