How to open file with IntelliJ IDEA in new tab with command line? - intellij-idea

How can I specify the file to open in new tab with IntelliJ IDEA via command line?
If I run in command line:
idea d:\Dropbox\Dropbox\featurea\featurea-common\src\com\featurea\common\util\FileManager.java
I get "No project found to open file in" error
Open file in new tab with opened project also fails.
Is there any way to manage IntelliJ IDEA to behave as I want?
Thanks.

You can't open individual files in the IDE from the command line when there is no open project and the IDE is not already running.
You can pass the project directory as an argument to open the project first, then you will be able to open individual files.

Related

IntellliJ IDEA LightEdit mode won't open file if IDE already running

When I use the idea command line tool to open a file in LightEdit mode
$ idea myfile.txt
and IDEA is already open in project mode it will not open file file. IDEA gets focus but the file does not open.
However, when I used the idea command line to open a file in LightEdit mode and IDEA is not already open, it works as expected.
If you use the Create Command-line launcher option to recreate the idea launcher file it will start working as expected.

Open a directory/folder from IntelliJ IDEA using Command Prompt

I want to open this folder which is a GitHub repository clone(D:\Acc\Tutorials\Programming\course-angularjs) from IntelliJ IDEA, using the windows command prompt. I can open the folder using commands like subl . for Sublime text and code . for VS Code. But I couldn't find the command to open it from the IntelliJ IDEA.
D:\Acc\Tutorials\course-angularjs>subl .
I found from some other answers that there is a way from IntelliJ IDEA, which is, Tools->Create command line Launcher. But I couldn't find it in mine. I am currently using IntelliJ IDEA Community version 2019.2.
I also used <Intelli IDEA> in the command prompt without knowing what it would do. But it also didn't work.
So is there any direct command for IntelliJ IDEA to open a folder, from the Command prompt?
Use idea . to open the project from the current directory.
To know more..

How to run a file in a new window in IntelliJ IDEA

I need to run the java file in a new window
IntelliJ IDEA. If I run this file with the project open, the file opens in it, and not in a new window
I tried to open by opening the folder with the file in IntelliJ IDEA, but this only works if some project is already opened in IntelliJ IDEA, otherwise only the project opens, but the file does not.
"path to idea" "path to project" && "path to idea" "path to java file"

A plugin to open a terminal in a particular directory selected from the project tree

I use git bash for my terminal configuration and it has --cd option where I can pass the path to open terminal in:
I have pretty deeply nested directory structure and thought it would be very convenient to open terminal in the directory I select in the tree:
Is there a plugin that can do that? If not, how hard will it be to write my own simple plugin?
It will probably be very basic:
read the currently selected folder path
run "open terminal" action supplied the command line string with the concatenated path
Thanks
there are no such plugins, please vote for IDEA-116724 and linked tickets.
You can try opening sh as External tool instead, like:
Program: C:\Windows\System32\cmd.exe
Parameters: /C "start sh.exe"
Working directory: $FileDir$
the only issue is that it will be opened as external window, not inside IDE

How to run Luke(Lucene tool)?

I had downloaded 'Lukeall-3.5.0' on http://code.google.com/p/luke/downloads/list It's a JAR file , but i don't know how let it work? Can somebody show me the detailed steps to run Luke? Thank you!
You can run eg. from command line issuing java -jar lukeall-3.5.0.jar command
If you want the .jar to run on double click then you have to make an association between .jar files and the program that needs to open them, javaw.exe. You can do this manually by following the steps below, or see this site for an automatic tool called Jarfix.
Right click the .jar and go to "Properties"
Click "Change"
Click "Browse..."
Navigate to your Java install folder
In the "bin" folder you should see "javaw"
Select "javaw" and click "Open"
Click "OK"
Click "Apply"
Tried everything including jarfix , javaW commandline but was not running.
Then I downloaded the jar from this link https://code.google.com/archive/p/luke/downloads. there are many .jar and .tgz file. I tried the latest one with "type-executable" label on it. And once it was downloaded somehow the extension got changed to .zip.
1) changed the extension back to .jar
2) right click open with -> Java(this was installed before)
Bingo! Luke opened up!
At first, you need to download and install Java Runtime to your PC.
Then open command prompt: press Windows Key + R, type cmd in the textbox and hit Ok.
Change directory to your jar file locating folder (using cd command), type java -jar .\yourFileName.jar and hit enter.
Hope this will work.