IntelliJ IDEA error: cannot find vm options file - intellij-idea

I'm trying to launch IntelliJ IDEA but the following error pops up:
Cannot find vm options file

This happened to me in Ubuntu 16.4, and the pycharm.vmoptions file was under the bin/ directory.
I was trying to run the shell script with this commands:
cd <path_to_pycharm_installation>/bin
source pycharm.sh
Running the bash script without the "source" command solved it for me:
./pycharm.sh

The explicit solution is to set an environment variable named $IDEA_VM_OPTION:
export IDEA_VM_OPTION="[path-to-'.vmoptions' file]"
Search in the file idea.sh:
grep -ri "vmoption" ./bin/idea.sh
You will see that the search path for .vmoptions file is either:
$HOME/.IntelliJIdea2016.2/idea$BITS.vmoptions
or
$IDE_BIN_HOME/idea$BITS.vmoptions
So, copy file bin/idea64.vmoptions into one of above locations if you have 64 bit JVM installed or file bin/idea.vmoptions else.

The following information is current as of April 23, 2019 for version 2019.1.1 of IntelliJ Ultimate that was installed via JetBrains Toolbox app version 1.14.5179
Locate the start menu item for IntelliJ. For me, it was at:
%APPDATA%\Microsoft\Windows\Start Menu\Programs\JetBrains Toolbox\
with the name:
IntelliJ IDEA Ultimate
right-click on the above item and choose Properties
Change the empty Start In: text box to read:
%LOCALAPPDATA%\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.6707.61\bin\
Once the above work-around has been performed, IntelliJ 2019.1.1 Ultimate will stop emitting the error:
Error launching IDEA cannot find VM options file

Related

How to download Appium Desktop in Ubuntu 16

I am trying to download Appium Desktop in Ubuntu 16 (I've just been using the terminal to run it so far).
I understand that for Ubuntu, I must download the source code release they have on git (Source Code tar.gz), as apposed to their .exe (windows) or .dmg (mac) releases. After downloading it and un-tarring it, I do not know how to "install" it. I tried reading the README.md, but cannot find the instruction.
How to do this?
Many thanks in advance
1.2.0-beta.2 offers an AppImage for Linux - https://github.com/appium/appium-desktop/releases/
Download it, run chmod a+x on it, and then ./AppImage to execute it.
Offical url: https://github.com/appium/appium-desktop/releases
If you have no idea which file to download, there's a file contains "linux" and end with format "yml", the file name is contained in it.
The file should be an AppImage file as above mentioned, you should change the permission by checking box of "Allow executing file as program" of its "Properties".
And then run "./appiumimagename" in terminal to launch Appium Desktop or install it.
download file named'Appium-linux-1.18.2.AppImage'.
change file permission to "Allow executing file as program" in file properties.
Right click and click on RUN.

Installation of Pentaho-Data integration

After extracting the Pentaho zip file I downloaded. I set my class path to JDK 1.7.0. But, upon running the Spoon.bat file I keep getting the statement: "Unable to launch your Java Virtual Machine (JVM)." How do I resolve this problem ?
NB: I have configured JAVA_HOME, JRE_HOME as stated by similar previously answered questions.
Note that Pentaho7 requires java 8.
In any case, Set the PENTAHO_JAVA_HOME=dir, where dir is the directory that contains the /bin/java.exe executable.
Alternative:
The spoon.bat [resp spoon.sh] runs first the set-pentaho-env.bat to find a suitable java. Edit this file to know in which order it searches for it. So do like me, when nobody looks at you, edit this file manually, and set _PENTAHO_JAVA_HOME and _PENTAHO_JAVA manually.
To check: In a command line shell, cd to your PDI install directory and type spoon.bat. It writes something like start "Spoon" "**some\directory**\javaw.exe" more stuff. Check that you can type **some\directory**\javaw.exe -version in your shell.
If not: in the same directory, type set-pentaho-env.bat. It writes down the PENTAHO_JAVA and PENATHO_JAVA_HOME thAt spoon will use. Edit that file until %PENTAHO_JAVA%\java.exe -version and %PENTAHO_JAVA_HOME%\java.exe -version answers the appropriate version.
In my case (for PDI 9.2.x), installing an Oracle JDK 8 solved the issue (no need to set the Java home folder explicitly)

Run IntelliJ code formatter from the command line

I am trying to run IntelliJ code formatter from command line.
I know that inspections can be run from CLI, however, they didn't provide the same for the source formatting (lame!).
Now, I started with CE edition of IntelliJ. Source code is on github.
However, since the code base is not small, I am having problems encapsulating the formatter.
Is there anyone who can point me in right direction and showing which classes to start with?
You can run the formatter from the terminal now. Like the code inspection.
https://confluence.jetbrains.com/display/IDEADEV/Command-Line+Source+Code+Formatter
/bin/format.sh [-h] [-r|-R] [-s|-settings settingsPath] [-m|-mask masks] [path1 [path2]...]
On Windows it's /bin/format.bat
To do this in the new versions of Intellij
You need to make sure the command line launcher is installed via the Jetbrain Toolbox.
Toolbox App Announcement
And run the following command from your shell:
idea format -s /path/to/your/style.xml /path/to/your/folder
I would recommend that you set the shell script location to /usr/local/bin/

How to know what JDK IntelliJ IDEA is using

I have looked at:
https://intellij-support.jetbrains.com/hc/en-us/articles/206827547-Selecting-the-JDK-version-the-IDE-will-run-under
and
https://intellij-support.jetbrains.com/hc/en-us/articles/206827537-Configuring-JVM-options-and-platform-properties
How can I know what version and path of JDK my IntelliJ IDEA is using?
I have tried setting the environment variable IDEA_JDK.
But I am not sure which version of JDK the IDE is picking up. is there a log I could see to verify this?
System information
IntelliJ-IDEA 15
Windows 7, 64 bit
Please look at the https://intellij-support.jetbrains.com/hc/en-us/articles/206827517-Locating-IDE-log-files to locate the log file which has the command used to start Intellij IDEA
For example, on OSX, ~/Library/Logs/IntelliJIdea15/idea.log has the following:
2015-10-17 16:26:52,339 [ 1086] INFO - #com.intellij.idea.Main - JRE: 1.8.0_40-release-b94 (JetBrains s.r.o)
2015-10-17 16:26:52,339 [ 1086] INFO - #com.intellij.idea.Main - JVM: 25.60-b23 (OpenJDK 64-Bit Server VM)
2015-10-17 16:26:52,378 [ 1125] INFO - #com.intellij.idea.Main - JVM Args: <snip>
If you don't have the Help -> Show log in explorer option, then please search for the file at c:\Users\Auyshman\.IntelliJIdea15\system\log\idea.log
Another alternative is to use Process Explorer and add/enable the column called 'Image Path' to see the complete path of the process for Intellij. This should show the JDK/JRE being used to invoke Intellij as well.
Default locations
On the Mac, the default location is:
/Applications/IntelliJ IDEA <version>.app/Contents/jdk/Contents/Home/jre
On Windows, the default location is:
C:\Program Files\JetBrains\IntelliJ IDEA <version>\jre64
(Does anyone know what the default location is on linux?)
If these default locations do not work, here are two ways to find out the actual location:
Method #1
Go to Settings → Build, Execution, Deployment → Build Tools → Maven → Runner
Open the "JRE:" dropdown list
Select the "Use Internal JRE" entry.
Look at the path. (It will probably be abbreviated, so you will probably have to divine it.)
Method #2
Execute the "Find Action..." action. The default key binding for this action is Ctrl+Shift+A. This brings up a dialog where you can type the name of any action to find it and execute it.
In the dialog that opens, type "Switch" and from the suggested matches select "Switch Boot JDK...". This will execute the "Switch Boot JDK..." action for you, which is not bound to any key by default and it cannot be found in any of the menus.
In the dialog that opens you can see the currently selected "Boot JDK". There is even a button to copy the path to your clipboard.
P.S.
I find it amazing that IntelliJ IDEA does not seem to readily provide this information. Every time I install a new version of IntelliJ IDEA I have to go to the IntelliJ IDEA JRE and execute the keytool to install a certificate into this new JRE so that it can access the internal maven repositories that we use. So, every time this happens, I need to know where the internal JRE is. And I usually have to do it both for the mac at work and for windows at home, which is quite tedious.
JVM version and name (but not path) is visible in the Help->About dialog.

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.