IntelliJ IDEA: How to navigate to class and line from external app - plugins

Is there any way how to navigate to a specific class and line from external app? I have external log app (LogExpert) and I would like to jump to a line by clicking on the log line. So I need to create some adapter app that will process line content from log app and somehow connect to IDEA, that will navigate to class and line.
I remember that Eclipse has some plugin that can listen on some port and navigate. Is there any similar plugin? I didn't found anything.

Using the command line idea --line 3 ~/Test.java jumps to line 3 of Test.java in a currently open instance or opens a new instance if none is already open.

Related

Automatically Activate Plugin in NetBeans

Can I create a module for NetBeans that runs in the background as soon as the user opens the NetBeans IDE? For example, I am building a plugin that captures the source code of the active JTextComponent (active code editor) in NetBeans, but I would like this plugin to always run in the background without having to be activated by the user clicking a button or pressing some key combination.
Is this possible, and if so, what is the best way of doing it?
Yeah, just create a "Install.java" inside the root package of your module and subclass it with ModuleInstall class, then start a process that runs continuously inside the restored() methods. The restored() method gets called on module installation and everytime netbeans starts. So your process will start as soon as the module is loaded in Netbeans.
ModuleInstall
Also checkout this section from DevFaqModulesGeneral.
Programmatic registration - ModuleInstall classes The module system
allows you to provide a ModuleInstall class, which runs some code
during startup or when the module is loaded, and can run cleanup code
when it is uninstalled or disabled. This is the least desirable way
to do things, because running code on startup means slowing down
startup. Before you use such a class, be sure there is no declarative
way to do what you're trying to do; see:
DevFaqModulesDeclarativeVsProgrammatic
To have some code run on startup/installation/uninstallation/etc., add
a line like the following to your module's manifest file:
OpenIDE-Module-Install: org/netbeans/modules/paintcatcher/PaintCatcherModule.class
This line should be part of the group of lines at the top of the
manifest, with no blank lines before it. It is a pointer to a class
file inside the module. The class file must extend the class
org.openide.modules.ModuleInstall. There is a wizard in the
development support to create and register such a class for you.

Server Google App Engine (1.8.2) at localhost failed to start

I am trying to create Dynamic Web Application in Eclipse on Google App Engine.
I have followed this tutorial exactly but whenever I Run on Server, I get the following error. I have shown both, error log and the dialog that appears when I run my project. And apparently there is no search result after Googling this error. Any help would be appreciated in this regard. Thanks.
UPDATE:
Point to note here is that if I use the tutorial available here then the project runs fine. The difference is that This way I create new project by clicking the New Web Application Project button in the toolbar:
It is because your launch configuration file is corrupt.
location: WORKSPACE/.metadata/.plugins/org.eclipse.debug.core/.launches.
All you need to do to solve this problem is to delete the existing launch configuration (in Run > Run configurations)
More precisely: Run > Run configurations > Web Application > right click in your project's name > Delete

The Web server is configured to not list the contents of this directory

Using Visual Studio 2012:
I created an "ASP.NET Empty Web Application" (using C#).
I used NuGet to install the FubuMVC package.
When I run the application (using IIS Express), I get the "Welcome to FubuMVC!" page which tells me to delete the FubuMVC.GettingStarted.dll file and to set the home page.
So I do both of those things, implementing a HomeController that simply returns "Hello World" from Index.
Rather than the expected "Hello World", I get an IIS error: The Web server is configured to not list the contents of this directory.
What have I done wrong?
try this
cmd => don't forget to run as administrator
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
Just tried reproducing your problem with a brand new project; it turns out that problem is that the instructions in the example haven't kept up with the changes in FubuMVC.
The instructions tell you to create a class called 'MyHomeController' and add the Index() method to it. This used to work, because one of the default rules for routes was to use any class with a name that ends in 'Controller'.
But the default has been changed in more recent versions, and the rule now looks for classes ending in 'EndPoint'.
So if you change the name of the class from 'MyHomeController' to 'MyHomeEndpoint', it should work.
Also, remember that the application pool needs to restart for the new configuration to take effect, so you might have to touch your web.config (or force IISExpress to restart).
Did you activate FubuMVC in your Global.asax? I usually see that error when there is no FubuMVC application.
So in Application_Start() (or whatever it's really called), you'll need something like:
FubuApplication.DefaultPolicies().StructureMap(new Container()).Bootstrap();
Where you're telling it:
1.) What are the policies/conventions to use
2.) What's your IoC container
Usually if I run into this it's because I've got a conflict with a route and a folder in the project. For example, I might have a folder called 'Unit' and inside it I have a class called 'UnitEndpoint' with a method 'get_unit' (which should map to '/unit' as a route, assuming I'm using the FubuMVC defaults).
In that case, browsing to '/unit' will result in this error because IIS thinks I'm trying to list the contents of the 'Unit' folder. Renaming the endpoint or the folder to remove the conflict will fix it (e.g., renaming the 'Unit' folder to 'Units').
I suggest that you recompile your application or at least touch your global.asax -- looks like you need to rerun the App_Start method.

(Eclipse) How to interact with console view?

Eclipse uses console view as read-only.
How can I type command in console view? Is it possible? E.g: ls, mvn install...
Edited:
Thanks Ben and Kelly.
I understand I can interact with Eclipse's console when my application is running. However, I meant I want an embedded console as like as the one in Kate, Dolphin (press F4 in Dolphin)... So I can use bash script in Eclipse's console. Is that possible? Or is there a plugin for that? I have googled but perhaps my keywords were not right...
Edited
Edward has found duplicate question here: Is there an Eclipse plugin to run system shell in the Console?
And it was answered :-)
I don't know how to mark this one as solved. So I place message here, I got the answer.
Edited
But it is not useful. It doesn't have auto complete feature, when I need to type a long file name, or want a hint for a forgotten name,... it is worst :-(
When the console is waiting for input it shows a green prompt that allows you type.
You can test it out by making a simple console application that reads from standard input.
You are trying to think of the Eclipse console as if it were connected to a command-line process. It is actually connected to the JVM used to execute your Java code. Thus, it only shows output that your program sends to System.out and conversely only is available for input if the Java code you are running is requesting input from System.in.
A decent exercise would be to write a small Java program that redirects the input and output to a child process of your favorite shell, for example: http://www.devdaily.com/java/edu/pj/pj010016
The Eclipse Console view is used for communicating with an executed program (typically Java, or similar). If you want to use it as a console, as mentioned in the comment under #Ben S's answer, the Target Management Eclipse project provides a view that can be used for that reason. I don't have it installed right now, so I cannot tell you the required plug-in/view name, but I have used it to connect to the local computer and works.

Eclipse/PyDev/GAE: How do I add command line options to my Run As->PyDev Google App Run

I am using Eclipse/PyDev to develop a Google App Engine project called GAEServer. One of my common operations is to right click on the project and select Debug As->1 PyDev: Google App Run. Which kicks of a debug session for my application.
I would like to change the command line arguments executed when this command is invoked (to relocate where GAE local server looks for its database). This requires me to add arguments to the executed command.
If I select from the main menu: Run->Debug Configurations... there is an expandable item called PyDev Google App Run which contains a list of items:
PyDev Google App Run
GAEServer GAEServer
GAEServer GAEServer (1)
GAEServer GAEServer (2)
...
At the moment I have 19 of these which is a little surprising. If I select the first one then there is a tab where you appear to be able to add arguments (x)= Arguments but if I edit this and try to debug as again, it does not invoke GAE with the additional options, instead it creates another GAEServer GAEServer (n) with the default settings.
It may be that I have set up my project in some odd way, that I'm not understanding how this is supposed to work or that I have uncovered a bug. Can anyone help me figure out which?
Thanks in advance
Jules
The run as will really create a new run configuration... Just erase the bunch of configurations you have, run it once and edit that one.
Later ( if you followed the suggestion on http://pydev.org/manual_101_run.html ), you should be able to Ctrl+F11 to rerun the last launch done (or choose it from the menu: run > run history > previous launches: can be accessed through Alt+R, T, number of config).