Intellij idea CE command line start for mac osx - intellij-idea

Just switched to intellij idea CE 2016.2. I'd like to know how to setup command line start for "idea". I created a link in the usr/local/bin, but got this error
idea[1627:20323] allVms required (null)
idea[1627:20323] Info.plist is corrupted, Absent JVMOptions key.

Use the Tools | Create Command-line Launcher... action.

For community edition of IntelliJ - on Max OSX - here's the mac'y way :) :
open -a "IntelliJ IDEA CE"

Related

Why can not idea2022 run python program?

I run a python program in idea2022.2, but an error appears, my environment is python3, jdk8, global enviroonment is python3. Does idea not support jdk8?
The burst error prompt is as follows:
'java.util.function.Function com.intellij.execution.target.value.TargetEnvironmentFunctions.getTargetEnvironmentValueForLocalPath(com.intellij.execution.target.TargetEnvironmentRequest, java.nio.file.Path)'
Workaround - disable Help | Find Action | Registry | python.use.targets.api.
Thanks to Pavel Karateev. Source:
https://youtrack.jetbrains.com/issue/PY-56176/Cannot-open-project-when-Python-plugin-is-enabled-in-202222#focus=Comments-27-6448075.0-0
Go to Settings/Preferences -> Plugins -> Installed
Uninstall Python plugin
Restart IDEA
Install Python plugin back
That should resolve the problem.
JetBrains at their best again.
Here is a solution for you:
Go there: https://plugins.jetbrains.com/plugin/631-python/versions
Download .zip of Python 222.4167.29 (Date Sep 14, 2022).
Press Shift 2 times, type "Plugins" and press "Enter".
Click the cog icon and then click "Install Plugin from Disk".
Select the plugin archive file (.zip) and click OK.
Click OK to apply the changes and restart your IDE if prompted.

IntelliJ IDEA error: cannot find vm options file

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

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.

SQLDeveloper not starting

When i try to start SQLDeveloper, it is giving me the following error in command prompt:
Error: This product requires a Java(TM) Platform 5.0 runtime.
You are using 1.4.2-b28 from C:\j2sdk1.4.2\jre
But my JAVA_HOME is set to java 6
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_32
Can anyone explain what exactly to do to resolve this?
Oracle SQL Developer uses a configuration file named products.conf which is situated at your roaming directory.
If you are using Windows 7 then the directory path will be:
C:\Users\\AppData\Roaming\sqldeveloper\1.0.0.0.0
Delete whole sqldeveloper directory from C:\Users\\AppData\Roaming\
Re run sqldeveloper executable, this will prompt for jdk home
Select jdk home. i.e C:\Program Files\Java\jdk1.7.0_55
Enjoy!
In my case i had 2 folders under C:\Users\username\AppData\Roaming\
sqldeveloper
SQL developer
after removing both of them and launching installation dir\sqldeveloper\sqldeveloper\bin\sqldeveloper64.exe it worked.
True acknowledgement / attribution belongs to Vishal at the following URL:
http://vishalorcl.blogspot.com/2012/12/sql-developer-from-11201-client-software.html. It describes in detail how to resolve this problem. From the page:
I am running Oracle 11g version of SQLDeveloper. I have same problem
noted above, after fresh install of Oracle. The summary is that
SQLDeveloper seems to require the Java 32-bit JDK.
Install 32-bit jdk V7 from Oracle:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
There is a sqldeveloper.conf file located in
C:\app\UserName\product\11.2.0\dbhome_1\sqldeveloper\sqldeveloper\bin
In the file change pathname within the line at end of file:
SetJavaHome C:\app\admin\product\11.2.0\client_1\jdk
To point to pathname of the jdk install directory; also sometimes
known as JAVA_HOME.
I had this problem too!
you should go to: C:\Users-your user name-\AppData\Roaming\sqldeveloper-version of your sql developer-
there is a file named product.conf there. Right click on it and edit it with notepad in the document change the address of java home and save it.
Done!
In my case, none of the other suggestions worked. Instead, I moved the installation directory from
c:\sqldeveloper
to
anything else
And things worked again. Perhaps, some Windows registry value got broken in an unfixable way...
I don't think SQLDeveloper uses the environment variable. There should be a .conf file that contains a reference to the JDK directory.
I solved this by deleting the folder /home/USERNAME/.sqldeveloper
After that, I started SQLDeveloper and without typing anything, it found the right java-version and started without complaining :-)
So, if you don't want to delete the whole folder, maybe search there for the file which defines the java-version :-)
edit: just found that:
"Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path
will be stored in ~/.sqldeveloper/jdk"
check the version of java that you are installing to you Pc the error show that you are using 4 so uninstall the java that you have then install a new one that is version higher than 5
Removing the instances from the registry worked for me.