How do I use an external diff tool to compare *folders* in Intellij IDEA? - intellij-idea

I am attempting to use an external diff tool (Beyond Compare) to compare folders in Intellij IDEA 13 (EAP Build #IU-133.471).
Settings
My Intellij IDEA settings are as follows:
Documentation
Relevant documentation for BC : here and here
Intellij IDEA's doc on the subject : here
Herein Lies the Rub
And here is what happens when I select two directories and press Ctrl + D (the shortcut to Compare Directories) :
The same works fine when comparing files:
I have attempted using the current stable version of both Beyond Compare (v3.0) as well as Intellij to no avail. I have had no joy after appending the parameters %1 %2 etc. to the Path to Executable either.
Can you think of what I might be missing ? Have you used an external diff tool to compare folders in Intellij IDEA ?
Am planning to ask this question in the Intellij forums and/or raise a Support Ticket with them after waiting to hear back from the SO community.
Thanks!
Update
Question now present in the Intellij IDEA forums too : http://devnet.jetbrains.com/message/5506980

This seems to be a bug in Intellij.
See this.
Update (9-Nov-2015)
I am using Intellij Idea v 14.1.5 and can confirm that this bug has been fixed.

I really like the IntelliJ plugin "Compare Directories" I have used it since IntelliJ 13.
Here's the plugin's home page: http://plugins.jetbrains.com/plugin/?idea&id=113
Once installed, the tool can be used by right clicking a directory or package and then setting the directory structure to compare against. This tool includes directory and file level comparisons.

Related

IntelliJ shows decompiled .class file instead of source code

I am having issues with IntelliJ - it shows me a "decompiled" version of the class instead of its source code if I ctrl+click the class.
This is what I see:
I am trying to open regular JDK source files.
The most relevant issue I found is explained here: Java sources replaced by decompiled files in Intellij
The most detailed answer I've found so far is there as well.
Yet it doesn't work for me:
Bytecode Viewer plugin is off.
Java Bytecode Decompiler plugin is off.
Platform, Project and Module all have same JDK version setup.
I have two JDKs available in IntelliJ: jdk1.8.0_161 and jbsdk8u112b287.2_windows_x86 (bundled with IntelliJ, but comes without src.zip). Tried with both (had to specify src.zip of jdk1.8.0_161 for jbsdk8u112b287.2_windows_x86) - no luck
src.zip is not corrupt - I can open it via WinRAR
When added jdk1.8.0_161 to IntelliJ, it automatically found src.zip. When manually adding src.zip to jbsdk8u112b287.2_windows_x86 Sourcepath tab - it started "Scanning for roots", but warned me that it "cannot determine what kind of files the chosen items contain" and offered me to "attach them as 'Sources'" so I agreed.
Tried File > Invalidate Caches / Restart... - same result.
Same issue in 2017.3 and fresh 2018.1 versions of IntelliJ.
Providing path for Documentation makes IntelliJ look for the documentation in the path specified. So it works as it should for both of JDKs. But not for sources.
Everything else works/compiles properly.
My settings:
1. Get the source files
Make sure you have downloaded and installed the source files of the JDK.
I'm on Arch Linux and installed them with pacman -S openjdk8-src which put a src.zip into /usr/lib/jvm/java-8-openjdk/. We'll use that zip file in the next step.
To list source packages of different JDK versions, do pacman -Ss "openjdk.*-src".
See this question on how to get the source files for your specific platform.
2. Point IntelliJ to the source files
In your module settings (open them with F4) under "Platform Settings" → "SDKs" → "Sourcepath", add the zip file containing the JDK source to your project JDK (be sure to pick the right JDK if IntelliJ lists more than one JDK) using the button with the plus sign:
3. Jump into the source
Select a JDK class, like Comparator, using IntelliJ's Search Everywhere or Ctrl+b with the cursor on the name of the class.
I also have the same problem. The problem for my case is that Project SDK is set to 13 [Invalid]. After I can Project SDK to a valid SDK. My problem is solved.
I tried all the things mentioned at other places for this but at the end I was doing a silly mistake. Intellij was pointing to JDK 11 for which there was no source code (I had both the SDKs 8 & 11). I removed JDK 11 and pointed to JDK 8. JDK had the source code, thus now I can see the source code on ctrl click. Also, I had disabled the bytecode viewer and decompiler plugins. Hope this helps some one.
This also happens for large files - IDEA decides to decompile them instead if indexing sources, which can take ages.
If you're willing to accept the drawdown, adding the following in Help | Edit Custom Properties might fix the problem:
idea.max.intellisense.filesize=4096
On ubuntu there was java version “OpenJDK” when I changed to “Oracle Java”, the error went away and javadoc returned
I meet same problem and finally it gone after I copy JDK to another folder and change config in IntelliJ. I think maybe cause there is a space in path before, because it is installed under "Program Files" folder.
For downloading the source code of class files belong to jar you can use download source option present on top right corner in the de-compiled class file.
On my Windows 10, expand maven:
For me going to File -> Project Structure -> Project -> SDK -> Add SDK -> Download JDK and selecting Oracle OpenJDK solved the problem. Prior to that I had a different JDK selected and apparently it didn't include source code
If you are in a maven project make sure in the project structure all the complied folders are in the excluded section.
I suggest to use Linux Instead of windows. It's easy to find and download Java.
If you are using Linux, you can download SDKMAN
Install Java by SDKMAN
# find version
$ sdk list java
# download
$ sdk install java x.y.z-amzn
ctrl+alt+shift+s add JDK
Switch project JDK
If you are using maven , Right click on Project explorer -> choose Maven -> chick on "reload projects"
This did the trick for me:
Make sure you select the option "Project Files" (instead e.g. "Project").

Golang plugin in intellij-Idea not finding all files

This relates to the go language plugin (version 0.9.15.3) for IntelliJ IDEA.
I have a directory structure in the following format:
src/
fred/
fred.go
bill/
bill.go
In (say) bill/bill.go, I import fred.go, and the compiler picks up references to fred.Something (when run from the command line).
But IntelliJ IDEA does not recognise the references to fred.Something; they come up in red, and actions such as 'go to definition' do not work.
Is there anything I can do to make this work?
I don't want to upgrade to the alpha version of the plugin if I can help it, unless it is stable (in which case, it should not be alpha).
Please don't use 0.9.15.3. The latest plugin should work properly for your case, if not please open a issue.
To get the latest plugin, please follow the instructions from here: https://github.com/go-lang-plugin-org/go-lang-idea-plugin#pre-release-builds

IntelliJ IDEA Report Highlighting error when using routes in Controller

I have a Scala Play project. I'm using Play 2.2.1. I downloaded Scala, Play 2 supported and SBT plugins. Everything is OK, but When I call route on Action in the Controller appear following error(Look screenshots):
I'm using IntelliJ IDEA 12.1.6 Ultimate version. Scala version 2.10.2
Anybody know how to fix this problem?
Thanks in advance!
Edit
When I generate my project to Intellij IDEA via "play idea" command in play console, and I opened project in IDEA project structure was such:
Then I saw answer #millhouse and discussing on this githup([Play 2.2] "play idea" creates not working source mapping in target) and I removed following folders from Sources Folders:
target\scala-2.10\src_managed\main\controllers
target\scala-2.10\src_managed\main\views
and "Report highlighting error" disappeared, but now there is another error:
and
my route:
And I've changed "Sources Folders" as shown below:
But it doesn't help me. And remains "Unspecified value parametrs" error.
millhouse's answer helped me find the right answer. Play 2.2 (and perhaps earlier versions, haven't checked) output a scala version of the routes file to project_dir/target/scala-2.10/src_managed/main So for IntelliJ to get the highlighting right you need to make sure that src_managed/main is added as a source folder. The reverse routes for javascript are for some reason included in project_dir/target/scala-2.10/classes_managed so you'll have to add that as well. (In your screenshot it looks like classes_managed is set to excluded so you'll want to un-exclude it by pressing the x button on the right hand side.)
Here's a screen shot of my project structure:
Update:
In Play 2.3 (or perhaps recent versions of IntelliJ) adding the classes_managed no longer fixes the problem. Instead of adding classes_managed to the project's sources add it to it's dependencies. By doing that IntelliJ should be able to pick up the compiled routes.class.
This is a common problem, it's because IntelliJ needs to be shown where to look for the compiled Scala templates and routes file. Here's how I fixed it on my IntelliJ 12.1 installation:
Go to the Module Settings for your project in IntelliJ (select the top-level, hit F4)
Choose the Modules item in the Project Structure window that appears
Select the projectname item (as opposed to the projectname-build item)
Add the compiler's output directory to the Source Folders items;
For Scala 2.10 it's target/scala-2.10/classes
I personally find the IntelliJ UI for this to be very non-intuitive; you might need to take the target directory and/or one of its subdirectories out of the Excluded Folders first
After applying that change, IntelliJ should see the results of compiling each routes and .scala.html file as just-another source file, so they won't show as "broken" and auto-complete should work for them.

ClearCase not working via Intellij Idea

Intellij Idea 12.1.4, Windows 7 Professional.
It seems bundled ClearCase Intellij Idea plugin not working at all. When I try to checkout(or type sth. in a file which is not checked out or hijacked) Idea says:
Cannot edit file(s): cleartool: Error: Not an object in a vob: {File path}
Actually this is an error that I am expecting because I couldn't find any ClearCase configuration that I can type my user name and password in Intellij Idea:
That's why it doesn't know where to connect and retrieve data. So question is, where are the correct configurations? Should I prepare a script for SCR text file or is Intellij Idea plugin useless?
Try first to fall back to cleartool (the ClearCase CLI -- command Line Interface), and check if your view is correctly configured.
cd /path/to/your/file
cleartool ls
That will allow you to see the config spec selection rule for that file.
And that will give you a clue for that "Not an object in a vob" error message: maybe the issue isn't in the plugin, but in your current view.
I know this is a contrite answer but the best advice really is: Don't use ClearCase.
Save your organization the headache and make the effort to switch over.
Anything will do, even svn.
Go to Settings, click on "Version Control". In the right-hand pane you need to add a Directory/VCS configuration tuple. Do this by pressing the green PLUS (+) icon.
Select "Project" and select "Clearcase" as Source Control tool. You should now have a context menu item "Clearcase" in your IDE and can check out files by right-clicking on the file. One small disadvantage in my Intellij 12.1.6 is that he only sees the change sets (Activities) that were created using Clearcase Explorer... (only loaded at startup time of Intellij). So you cannot add new change sets that will be propagated to Clearcase.

IntelliJ IDEA "cannot resolve symbol" and "cannot resolve method"

What are common causes for IntelliJ IDEA not being able to resolve built-in JVM types and methods? For example, when I mouse over String the tooltip says "Cannot resolve symbol 'String'". It's as if IntelliJ has doesn't know where the JVM is.
By the way, I am running OS X 10.6.6. Everything was working fine until I ran the system update this morning.
Most likely JDK configuration is not valid, try to remove and add the JDK again as I've described in the related question here.
First check if you have configured JDK correctly:
Go to File->Project Structure -> SDKs
your JDK home path should be something like this:
/Library/Java/JavaVirtualMachine/jdk.1.7.0_79.jdk/Contents/Home
Hit Apply and then OK
Secondly check if you have provided in path in Library's section
Go to File->Project Structure -> Libraries
Hit the + button
Add the path to your src folder
Hit Apply and then OK
This should fix the problem
I was facing the same problem when import projects into IntelliJ.
for in my case first, check SDK details and check you have configured JDK correctly or not.
Go to File-> Project Structure-> platform Settings-> SDKs
Check your JDK is correct or not.
Next, I Removed project from IntelliJ and delete all IntelliJ and IDE related files and folder from the project folder (.idea, .settings, .classpath, dependency-reduced-pom). Also, delete the target folder and re-import the project.
The above solution worked in my case.
For me, I had to remove the intellij internal sdk and started to use my local sdk. When I started to use the internal, the error was gone.
I tried almost everything but nothing was helping with the ibm jdk 1.8. to fix this issue. then I found an article from https://youtrack.jetbrains.com/issue/IDEA-279214/Cannot-resolve-symbol-String-when-using-IBM-JDK-180 and it worked like charm!!!
so sharing original help credit goes to #Serge Barano. incase anybody needs and not able to able to resolve the issue using previous solutions like me.
according to the article answer is:
IBM JDK has a weird layout and the jar with the String class is in bin directory for some reason:
d:\dev\ibm_sdk80\jre\bin\default\jclSC180\vm.jar
If you add it to the JDK classpath in IntelliJ IDEA, the issue should resolve:
For me, IntelliJ could autocomplete packages, but never seemed to admit there were actual classes at any level of the hierarchy. Neither re-choosing the SDK nor re-creating the project seemed to fix it.
What did fix it was to delete the per-user IDEA directory ( in my case ~/.IntelliJIdea2017.1/) which meant losing all my other customizations... But at least it made the issue go away.
First of all you should try File | Invalidate Caches and if it doesn't help, delete IDEA system directory. Then re-import the Maven project and see if it helps.
For me ,
File -> project structure -> Project Language Level (11) selection worked. Local variable syntax for lambda paramters.
In my case, cloning repo from the remote was the easiest way to solve this issue.