IntelliJ and Eclipse gives different result - eclipse

For some reason my project gives the below error in eclipse:
No error in IntelliJ. Any ideas?
Using IntelliJ:
IntelliJ IDEA 2016.2.5
Build #IC-162.2228.15, built on October 14, 2016
JRE: 1.8.0_112-release-287-b2 x86
JVM: OpenJDK Server VM by JetBrains s.r.o

The reason behind different results is that Different IDEs use different inspection tools.
In your particular question Eclipse shows an error, while Intellij shows a warning. So anyhow both are suggesting that something has gone wrong here.
Besides it's a warning or an error, the point both are making is Not to use key duplication in json. The reason is when you refers the value via the key then key duplication causes problems.
Since JSON is just a markup language and creates no problems for project build, Intellij would just make a warning and not an error. Since key duplication does make no sense though, Eclipse would mark up as an error. Anyway not to worry about whether warning or error, just catch the point they are making. :))

Related

Eclipse CDT cannot launch the binary it generated, but launch works from cmd

I am using eclipse juno, and using windows pe parser and mingw compiler. I am not using cygwin. I can build a binary successfully from eclipse, but cannot launch it. It fails with some null pointer exception.
I get the following error on eclipse.
"OpenCV Error: Null pointer (Invalid classifier cascade) in cvHaarDetectObjectsForROC, file C:\opencv210\opencv\sources\modules\objdetect\src\haar.cpp, line 1514
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
"
I run the same binary from cmd, it executes fine without any error. Can someone give any pointers please?
your xml-cascade file was not found.
also, please avoid using opencv's deprecated c-api. use a cv::CascadeClassifier in the 1st place, and check CascadeClassifier.empty()
btw, i'd urge you to update from opencv2.1 to opencv2.4.9 . 2.1 is totally outdated, and should no more be used.

Why does eclipse close by itself while running?

It's been happening lately for some unknown reason.I have the latest version of Eclipse ADT (25 Sept 2014) and it just shuts off while I'm working. Any ideas?
Start Eclipse from a terminal to see the standard output. Chances are that the Java VM runs into a problem because of SWT which can crash the VM. Note: If you're using Windows, you may have to use java.exe instead of javaw.exe to get output.
Also look into the Error Log. Eclipse has a view for that or look into the file .../workspace/.metadata/.log The file might contain an error message.
If you find an error in either the console or the error log, let us know and we might be able to help.
The issue could also be because of the JVM that was chosen for the project.

Scala compiler never ending compilation

I noticed my Scala IDE consuming all the available CPU... I tried to compile the project via SBT from the command line and I got the same situation.
How can I get to know what's going wrong? Is there a way to find out what file or class/object/trait is being compiled?
I'm getting the same issue in 2.10.2 and 2.10.4-RC1
I found out the problem was due to importing a library from Slick 2.0 called heterogenous.syntax. I also got a contact with the Slick developing team in order to give'em some code to investigate on.

How do you use external Scala compiler with IDEA 12?

How do you use external Scala compiler with IDEA ? I seem to have randomly appearing errors saying "scala: Cannot connect to compile server at localhost/127.0.0.1:3200"
Sometimes it works. Sometimes it doesn't. I can't find the pattern.
Here is what I have in the log
9:20:58 PM Auto make completed with errors
9:21:09 PM Using a new (SBT-based) Scala compiler.
In case of any compilation problems you may enable the previous (internal) compiler by clearing:
Project Settings / Compiler / Use external build
9:21:10 PM Scala compile server
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
9:21:12 PM Compilation completed with 1 error and 0 warnings in 3 sec
I'm using
IDEA 12.1 (129.161)
Scala compiler 2.10.1
Scala plugin 0.7.213
JDK 1.7
Windows 7
In Project Settings / Compiler / Use external build is checked.
In IDE Settings / Scala / Run compile server is checked.
Do I need to launch compiler server manually ? Anything else ?
UPD: Looks like bug to me. I posted JIRA ticket http://youtrack.jetbrains.com/issue/SCL-5523
You need to lower the heap size from 1024 to 512 or something. Then the compile server can be created and started.
Tried with the InteliJ 13.0.2 (133.331) and Scala plugin 0.26.361
Go to Settings -> Compiler and uncheck "Use external build"
It normally works without having to change any settings. This sounds like either a port conflict, a result of a previous unclean shutdown, or insufficient heap size.
Try changing the compile server port by going to Settings -> Scala (under IDE settings list, towards the bottom) -> TCP port. Over there, you can also set a different max heap size.
The issue may be related to this open ticket.
The bug I filed is marked as Fixed. JetBrains explanation is
"Fixed" means that compilation now works by default, so the major problem (as the title states) is resolved.
However, an automatic initial compile server startup before auto-make is still cannot be easily implemented. That is why auto-make is still turned off by default for Scala projects. And, of course, we're going to support auto-make after all.
I had the same issue with IntelliJ , if you open the event log (on the bottom right corner of IDE)you can see the error message that scala compiler is not configured with the jdk version and gives a link to set it up.
In Settings > Languages and Frameworks > Scala Compile Server > JVM SDK set the java you are using for the IDE as in this screenshot
you can try this simple project I wrote, which uses the sbt-idea plugin. It should work out of the box with latest Intellij IDEA or Scala IDE (EClipse)
skeleton
Reducing Heap Size to 512 or 128 MB worked for me

Eclipse #ifdef error using JNI, Android NDK and Vuforia

With Vuforia's ImageTargets sample application, I tried using OpenGL ES 1.1 by setting USE_OPENGL_ES_1_1 to true in jni/Android.mk and uncommenting and changing the corresponding line in AndroidManifest.xml (). After converting the project so that it has a C++ perspective and associating ndk-build and the proper include directories, I could successfully run the application on my Android device.
However, the problem is that once I open up jni/ImageTargets.cpp, I get several errors from Eclipse, all from places where OpenGL ES 2.0 code would execute, the first one being:
Description Resource Path Location Type Symbol 'vertexHandle' could
not be resolved ImageTargets.cpp /ImageTargets/jni line 402 Semantic
Error
Sure enough, vertexHandle is defined at the top of the ImageTargets.cpp, inside the "#ifdef USE_OPENGL_ES_2_0" block. Because USE_OPENGL_ES_2_0 is not defined (per Android.mk), the code should be able to compile successfully, and sure enough, ndk-build does not report any problems. So it seems that only Eclipse reports the problems and when I run the project, Eclipse says, "Your project contains error(s), please fix them before running your application." And thus, I cannot run my application anymore. In a sense, it's kind of strange that this never occurred until I opened ImageTargets.cpp and Eclipse "discovered" the errors.
The best work-around I've found so far is to just delete or comment out those lines (that should not be causing problems because USE_OPENGL_ES_2_0 is not supposed to be defined)... Is there a better way to deal with this problem? Did I miss a setting in Eclipse that should solve this?
I've found a solution: go to the project properties -> C/C++ Build -> Discovery Options -> Check "Automate discovery of paths and symbols"