Terminal gets blocked when opening Intellij - intellij-idea

as I have set the Path variable to point to the "bin" folder of Intellij I can project from the command line by navigating to the specific folder and then executing idea ..
The problem now is that when starting Intellij the console is blocked. I can of course press Ctrl + C to end the execution but then Intellij is closed.
a) Is this the normal behavior or did I set something up wrong?
b) How do I change it? Basically I would like open “Intellij” and still be abel to use the console afterwards.
I am using the Intellij Idea Community Edition on version 2021.3.3

This is normal behavior. The termial accepted the command and is waiting for it to terminate. You could start the command and let it run in the background, so the terminal returns, and the process does not stop:
On Linux:
idea . &
On Windows:
start /B idea .

Related

Start IntelliJ run-configuration from command line

I work on a Kotlin-based cloud microservice. From time to time I need to run it in the IntelliJ debugger, but we often accidentally break the "local debug flow". There is no pipeline that checks if the IntelliJ run-configuration and the somewhat complex set of cloud-simulating proxies and mock-servers are in sync with the code base.
I would like to write a script that helps me check if the local debug flow works. The script should do the following:
build the project
start up the "mock cloud"
start the service locally using an IntelliJ run-configuration
run a Postman-collection against the locally running service
I need help with step 3 (and possibly step 1): How can I start the IntelliJ run-configuration via command line? I am using IntelliJ IDEA 2021.2 and MacOS 12.3.1.
There is no built-in way to start a Run Configuration from the command line. Instead, you should execute java/kotlin binary with classpath etc.
For example, for "Application" configuration it is needed to run the command like that:

Could not delete caches dir when compile Kotlin in Intellij IDE

My project use plugin kapt to generate mapper.
When run app then can not compile Kotlin (image below)
If remove plugin kapt then it not happend.
To resolve I must restart Intellij IDE. Take more time.
This error probably only happen on windows
This is a Kotlin bug, you can vote and watch it for updates: https://youtrack.jetbrains.com/issue/KT-36253. A workaround is to kill the running Java processes.
I have this problem almost every build (Android Studio stable + Artic Fox).
Manual Solution (try this first, if it works continue)
Task manager > Processes > End "OpenJDK Platform Library" tasks
(sometimes it's standalone, sometimes it's under "Android Studio")
OR
Task manager > Details > End "java.exe" tasks
Automated Solution
Create a new end-java.bat file
Content of .bat file: taskkill /f /IM java.exe
Right click end-java.bat file > create shortcut
Right click the shortcut > properties
Add shortcut key (e.g. ALT + CTRL + 1)
ALT + CTRL + 1 will now fix the issue
Try This :
https://developer.android.com/studio/build/build-cache
Add this code :
// To re-enable the build cache, either delete the following
// line or set the property to 'true'.
android.enableBuildCache=false
After that clean project and restart android studio
Also you can try to use a different JDK (e.g. OpenJDK). It helped me.
File -> Project Structure -> SDK Locations -> JDK Location
You can reboot the system, it will help. But this problem will return soon. This is the bag of Android Studio 4.2 https://youtrack.jetbrains.com/issue/KT-36253

CMD window Close automatically after Jenkins build is over

I trying to run Selenium grid and node using Jenkins but the CMD windows always closes after executing the steps
i am running the below code in Jenkins Window Batch Command
cd "C:\TapsiumACSS\Grid3.9"
start Hub.bat
I need the CMD window to be opened
You can create a shortcut of the bat file and under properties in the target section you have to add &PAUSE
This will pause the command prompt until an user input is done.
Just a opinion, Not a good idea to use Jenkins and ask the user to do something as that defeats the whole automation aspect... Instead copy the selenium results into a html or text file which can be viewed later :)
P.S. you will have to refer to this bat file location in Jenkins i.e. the shortcut location
Hope it helps :)

I am trying to open Jmeter by the batch file but it gives me a Windows error

Here is the related error its showing:
java.exe is not a recognized file as an internal or external command,
operable or external command
errorlevel=9009
i was getting the same error on WIndows 8.1(64 bit) and checked java path but it was ok
so i just run my jmeter.bat with Run as Administrator and it worked for me
Many operating systems have an environment variable such as PATH that contains a list of directories (or folders) to be searched when looking for a command to execute. Commands that can be found via the PATH are commonly called external commands. The program that reads the command line or the batch file and invoked the commands may have a number of built in commands, these are commonly called internal commands.
I suggest you examine the PATH (or equivalent) set when your java command executes from the command line and also when execution is attempted from the batch file. Compare the two and make sure the directory containing your java.exe is in the PATH.
Does not work with Java 9 beta:
Running:
C:\java -version
Gives:
java version "9-ea"
Just go into command line and run:
java -jar ApacheJMeter.jar
Set the correct Java Path (installed in your system) in Computer -> Advanced System settings -> Environment Variables -> Ok -> System Variables -> Path
I got the same issue and resolved by following the above steps.
I tried everything, this eventually worked.
Within System Variables:
PATH = "C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.8.0_101\bin"
May help someone.
This error occurs due to the path has not been set properly.
Either you can set it in environmental varialables or right click jmeter .bat file,choose edit set the path their,for reference see the jmeter.apache.org user manuals.
For me, my Java path has a space in it and jmeter said it can't find Java
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
.. I looked at the jmeter.sh script and saw it got the path from "Plugin-Ins" .. onward. I tried just commenting out the exit command after that check in the script .. and then I was able to run jmeter.
So apparently the validation logic has a bug, where the error message about can't find java is in fact not true (if Java is indeed set up correctly), so it can be ignored.
For windows 8.1 Users:
Error when trying to run jmeter.bat
Error message:
Not able to find Java executable or version. Please check your Java installation. errorlevel=2
Press any Key to continue
Resolution:
Right Click jmeter.bat and Run as Administrator.
This worked for me, hope this helps. Good luck
Set the correct JM_LAUNCH variable to java.exe
For Windows XP users set Java environment by following the steps here:
http://www.tutorialspoint.com/jmeter/jmeter_environment.htm
Note the path depends on your installed JDK.
And download the file from:
https://svn.apache.org/repos/asf/jmeter/trunk/bin/jmeter.bat
Then replace your jmeter.bat with the downloaded file.
If you have installed Java and still you get this error, please set the java_home path to below using typing below command in terminal:
export JAVA_HOME="/Library/InternetPlugIns/JavaAppletPlugin.plugin/Contents/Home"
Since I run many versions of Java.. I modified jmeter.bat.
rem JM_START - set this to "start" to launch JMeter in a separate window
rem this is used by the jmeterw.cmd script.
rem
rem =====================================================
setlocal
rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0
set PATH=%PATH%;C:\Program Files (x86)\IBM\Java80\jre\bin <<< add This line to jmeter.bat
Copied the JAVA executable from Installed version of Java from C:\Program FilesJava\jdk1.8.0_191\bin and pasted in the folder where the jmeter bat resides and it worked for me.
Not exactly the same issue but somebody might find it helpful
Do not double click jmeter.bat but instead ApacheJMeter.jar in the same directory
For me jmeter.bat run but for a brief moment closing almost immediately and not prompting any error. Above workaround allowed me to start working
if JAVA -version shows as blank or empty in the command prompt (CMD) then you need to clear the all java paths in environment variable and again add JAVA_HOME=C:\Program Files\Java\jdk-11.0.15.1
path= C:\Program Files\Java\jdk-11.0.15.1\bin;
if you see C:\Program Files\Common Files\Oracle\Java\javapath; like this remove this
and try in new CMD prompt then Java -version will work.

Using applescript to run terminal and passing a argument to compile

I am new to applescripts and i want to automate a little bit of my app.So here is the thing
1) I am using textwrangler as an editor
2) After writing code and saving it i want to compile the file by opening terminal from applescript.I already installed llvm compiler.
3) As textwrangler provides me the a menu in meubar to open script editor so after opening it i am using "tell application "Terminal" to activate" it opens terminal
4) i want " gcc myfilename.c " to be passed as argument from applescript so that as soon terminal opens this string should be passed as argument and executable is generated
Can i Do that through scripts? Please help.
Give this a try:
tell application "Terminal" to do script "gcc myfilename.c"
Running this without the Activate line you mentioned will still open Terminal if it isn't already open, but it won't bring it to the front. For that, Just turn the whole thing into a tell block and put the Activate back in there so it becomes:
tell application "Terminal"
activate
do script "gcc myfilename.c"
end tell