Is there a way to open launch eclipse from command line, like vscode? - eclipse

I am wondering if there is a command similar to code ., but for eclipse.
I'm using a Windows 10 computer.

Yes, the command line lets you open files using the --launcher.openFile parameter, and I think it prompts you with the "open projects from file system" wizard when you give it a directory. I'm not sure it works as smoothly since Eclipse lets you use the same binary for more than one workspace.
https://wiki.eclipse.org/Eclipse/OpenFileFeature

Related

Copy and Paste mouse shortcuts in Git Bash terminal in Eclipse

The text cannot be COPIED by double-clicking and PASTED on right-clicking when working on Git bash in Eclipse, similar to the usage in Git Bash Windows application, which saves much time.
Is there any solution or best terminal alternative integrated in Eclipse?
That does not seem to be supported by the Terminal component, part of CDT since Eclipse 2020-03, with code source now in org.eclipse.cdt.git/tree/terminal.
No issue has been mentioned in this bugzilla list, which means you would need to create one to mention this use case.

Eclipse --launcher.openFile does not open the file

I have been trying to open a file from the command line in a running Eclipse session. Based on the documentation, I should be able to do
eclipse --launcher.openFile myfilename
However, when I do this, there is a long pause, and then Eclipse tries to launch a new session. It gives me an error message that the workspace is not available, and then wants me to choose a new workspace.
How do I open a file in the currently running Eclipse session, from the commandline?
As of Eclipse Helios (3.6) you don't need special command-line parameters to open files from the OS file explorer or command line (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=4922). I think you should be able to just do eclipse myfile.java (as long as you have associated .java files with Eclipse).

eclipse command line switch to start with project

What is the command line option to start eclipse with a specific project?
I can get the correct workspace using -data.
Within that workspace, I want to have a specific project loaded, similar to the "Go Into" command.
I don't think there is such an option right now.
Oening a file from the command line has only taken 9 years: bug 4922:
If your Eclipse Helios 3.6 eclipse.ini file contains "--launcher.defaultAction", you can open any file with:
eclipse.exe myFile
But open directly a project is still missing.
See this SO question which contains an Eclipse plugin that only loads specific projects (which are defined in a config file) into the workspace.

Is it possible to add external command line tools to Netbeans?

Is it possible to use external command line tools in Netbeans?
Thank you.
After searching and searching and searching, this feature is just missing in netbeans although it would absolutely straightforward to implement and has been ask by user for 2 more than years...
Regards,
Stéphane
There is a Terminal window in NetBeans 7:
Open the menu, Window -> Output -> Terminal
What about using an Ant target? Ant files are quite comfortable to run from Netbeans.
<exec executable="${executable-full-path}" ...
The best option I've found is to use jmarsault's plugin that he calls NetBeans Command Shortcuts. This give you an icon in the command line where you can add command and terminal scripts to run. The display shows in the output window.
Installation files are available here and he has kept it up to date with the newest versions of NetBeans.
NetBeans Command Shortcut plugin
Installation:
Download the .nbm file for your version of NetBeans
Open Tools / Plugins / Downloaded / Add Plugins...
Select the .nbm file and allow the installation of the plugin.
In since at least version 9.0, there are two decent options:
Just create a script file. (I think you need the C++ plugin for this. Otherwise you have to create it outside NetBeans or as a text file.) In my case I created a JLinkGDBServer.sh that just executes JLinkGDBServer as a prerequisite to start an embedded debug session. This automatically sends the executable's output to a NetBeans terminal.
Add a tool to Tools/Options/Miscellaneous/SendTo. SendTo is a pop-up menu item for certain project entities, for example files but not the project. In my case, I could add a SendTo running the executable and use it by right-clicking on for example the .elf file (although for the GDB server I don't need any file name as an argument).

How to run a batch script (.bat file) from eclipse

My Java application is started by running a set of commands that are present in a batch file (.bat file). And I imported this into Eclipse workbench. How do I execute the batch file from Eclipse. Similar to the one in command line, I directly give "path:\myBatchfile.bat". Is there any way I can do directly from Eclipse.
You can call your .bat file using the External Tools feature (in the Run menu).
Example:
Or, you could create an Ant build file, which can call external applications.
This will give you the advantage to call the .bat not only from Eclipse, but other IDE's, or from command line (on any machine).
http://ant.apache.org/manual/Tasks/exec.html
You can also run a batch file (or any other executable file) by opening it with the System Editor. Use Open With -> System Editor.
Associate with text Editor by right-click - Open With
(As of 2017 there is no plugin with special editor )
To run install plugin like https://marketplace.eclipse.org/content/easyshell
You can easy run .sh with Git Bash as well
or https://github.com/culmat/eExplorer