View execution line in netbeans - netbeans

How can view the execution line used by netbean v6.8 to execute my java application when I press the run program button (right pointing green arrow)? I'm looking for something like:
java -cp build/class Main
I'm trying to make the jump to java IDE developement from 15 years writing c and c++ with vi. I'm starting with netbean since it seems to have the best vi key bindings.

I figured out what I was looking for. Tools->options->Ant tab, where is says 'Verbosity level' set to debug. Then run the application and look for 'Complete build sequence is [run, ]', a few lines down from that is the execute statement, in ant exec format.

If you want to debug your application, you have to select the option "Debug" and not "Run". In the "debug" option you can set breakpoints and execute the program step by step.

Related

Run a local command before starting eclipse debugging

I want to run a terminal command just before a debug configuration starts on Eclipse.
I heard about CDT launch Groups, but couldnt get around it fully. I need to just run a normal terminal command, nothing fancy.
The aim is to copy some stuff over to the execution path before actually starting the debugging.
I managed to do this via "Launch Groups" in the CDT. Creating 2 groups, one as a c/C++ Application which calls a shell script that includes the command I want to run. And then the normal debug configuration I wanted to execute.

eclipse debug perl curses

I am writing a Perl program that uses curses for output and move the cursor, and color characters. Previously, when I was working under windows I use Komodo it was able to run an external console.
Now I work in Linux environment and use eclipse + epic. If you try to just run the script, it uses the internal console eclipse, which is very cut. You can just run the script using external tool, but I'm interested to debug using external console window. Is this possible?
Unfortunately, use of a File and /dev/pty/1 does not help in solving my problem.
The fact is that in this case it is impossible to get the characters introduced in the console through curses getch(). Always returned 1 instead code of pressed key.
Here is an answer that will take you most of the way (based on post #6 of: http://ubuntuforums.org/showthread.php?t=743131, although since then, in the "Indigo" and "Juno" versions of Eclipse, things have changed somewhat, and this answer is up to date):
Go to "Run -> Debug configurations". Click on the (fourth) "Common" tab. Go to the third frame from top, and there, check-mark the checkbox which says: "File". Enter the file name of the console window you want your output in.

Plugin to switch run configuration quickly in eclipse

Is there a plugin which can help to switch run configuration quickly in eclipse?
I am trying to learn django with practice a Eclipse with PyDev. I am follwing this page. This page frequently need to supply different parameters to manage.py, for example:
If you're interested, also run the following commands:
python manage.py validate -- Checks for any errors in the
construction of your models.
python manage.py sqlcustom polls -- Outputs any custom SQL
statements (such as table modifications or constraints) that are
defined for the application.
python manage.py sqlclear polls -- Outputs the necessary DROP
TABLE statements for this app, according to which tables already exist
in your database (if any).
To follow the tutorial, I will need to click the triangle next to the run button , then click "Run Configurations..", then select "Arguments" tab. Modify the argument, press "Apply", then press "Run".
I don't want to repeat each step to have different parameters. Is there other way to do it quickly? Maybe a plugin?
I am not sure if this is the right place to ask, if not, please help to move it to proper place.
Actually, for Django, the PyDev integration should have what you want builtin...
The steps on http://pydev.org/manual_adv_django.html should be more complete, but mainly you have to configure your project as Django and then in any PyDev editor you can do
Ctrl+2 dj (and then press enter)
to open a dialog to choose which django command to run.
Or you may enter the command directly there... i.e.:
Ctrl+2 dj syncdb (when pressing enter syncdb will be run directly)
-- note that it'll use the manage.py configured in the project to which the editor is related to run the command (so, the opened editor must be an editor from the project).
Another option would be right clicking the project and selecting the option under the 'Django menu'.
p.s.: If in some occasion you really had to change the command line all the time, the ${string_prompt} variable could help you -- although other variables in the run configuration could be more suited depending on your use case.
p.s.2: I think you could rename this question to note that what you want is related to running the django manage.py in PyDev (if that's really your use case).
Eclipse Runner could do this for you.

Whats the shortcut to Debug in PyDev using Eclipse

The shortcut key is F11 to start debugging. But issue is that I have to be on that file and then hit F11 to start debugging.
Eg.
my file to launch the application is "launch.py" and "example.py".
example.py is open in the editor whereas launch.py is not.
Now, if I hit F11 it will try to launch the application using "example.py" and terminates due to error (as expected).
So then I have to open the "launch.py" in the editor and then hit F11 to start debugging the application.
Is there any neater way to configure the debugging, so that it starts the application in single hit/key?
Edit: example.py is some other file (some module). It does not launch the application.
As this PyDev Eclipse Tutorial suggests:
After the first run, if you type Ctrl+F11, the last file ran is re-run. Or, if you type just F11, a debug session is started with your last run. Let's test this...
Note: This behavior changed in Eclipse 3.3 -- but it's generally recommended to restore it in the preferences at: window > preferences > Run/Debug > Launching and set the Launch Operation to Always launch the previously launched application.
This tutorial will always consider this as the default option.
So, did you have this option selected?
If you have launch at least once launch.py, then you can re-launch it easily.
Although this isn't strictly an answer to what was asked initially, it might help someone looking here that had the same problem as me...
I'm a Java developer mainly, so have the Java view open almost all the time. However, sometimes I want to run some python file to test something (or just create a quick python script, and run it)...
In the Java editor, if the current class has a main(String[] args) method, I run it with (and popup the dialog to ask me what exactly I'd like to run in the middle)
alt+shift+x, j
Unfortunately, that doesn't work in the Python view, and I've not found a similar solution - it just asks me if I'd like to run it as a Java app... however, as the VonC says, you can run the last run thing (provided you've set the preferences accordingly) with
ctrl+f11
and this seems work well with python run configurations too.
But... What if the last thing I ran was a Java program, but I now want to run the active .py file? Previously, to run the .py file, I'd have to go digging through the buttons on the toolbar with the mouse, and I tend to prefer keyboard shortcuts...
Solution! So, finally I come to the actual useful bit of this answer - I just discovered by accident (typing Ivan's suggested shortcut, but missing!), it appears that
f9
will run the currently active python file.
Hope that helps someone get just that little bit faster...
I use CTRL+SHIFT+F9 to relaunch the previous debug configuration in Pydev.

Eclipse - Running programs not in the native eclipse console

I'm currently writing some ncurses code and the native Eclipse (3.2.2) console can't display its graphics. I'd instead like to run the program through xterm. What I want is to be able to start xterm and run from there. I'd prefer to not get involved with any plugins or that jazz. Just something simple.
EDIT
So I have the answer and it was pretty simple...
Run -> External Tools -> External Tools -> New Launch Config...
Then select location of your terminal emulator. /usr/bin/gnome-terminal in my case.
after that set the appropriate arguments. "-e ~/ncurses/start" in my case.
Then make sure you aren't allocating a console by unchecking that option in the "Common" tab.
Annon add to his question:
its a pain to keep switching back and forth from eclipse and the terminal. I'm looking for a way to just hit something like"F5" and have it run my ncurses program in a new xterm terminal process
The simplest way to do that is to report the command line into an external tool configuration, and point eclipse to use a shell (like described in this program)
In the argument, you will add the command line eclipse execute (command line which can be retrieved as mentioned in the second part of this answer below).
Of course, replace 'cmd.exe' by the shell of your choice, and try not setting the 'Allocate Console' checkbox in the Common tab of that external launcher.
To launch through a xterm, without eclipse involved (not what you are asking for, just keep here for archive)
You can launch your program through Eclipse (Run Configurations), and observe through a 'ps' command the exact Java command line used.
Or launch it in debug mode, and right click the task in Debug view and open Properties. It will show the command line, as documented here.
Then launch that command line directly in your console (Eclipse being not involved at all at this point).