For the first time I encounter problem when I can't debug Java program in Intellij IDEA. Output to command line works, but breakpoint is ignored..
May be it's because I created Maven configuration to start the program.
It might be that I'm disconnected from JVM, but I have no idea how to connect to.
What can be the cause of such behaviour?
If you're talking about debugging something running in Maven with IntelliJ, you can
Run the maven build through IntelliJ and debug it like anything else, or
Run your build using mvnDebug instead of just mvn. It will wait for a debugger to connect on port 8000. You can have IntelliJ do this by creating a Run/Debug Configuration of type "Remote" that connects to localhost:8000.
If you are facing with non-triggered breakpoints, see following:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003676199-Can-t-debug-any-Java-or-Kotlin-application
In my case disabling android plugins solved the problem.
My solution was the following in IntelliJ. Go to:
Settings -> Build, Execution, Deployment-> Build Tools -> Maven -> Runner
Make sure to uncheck the box 'Delegate IDE build/run actions to Maven'
After that, I could debug and the breakpoints worked properly.
Remember that Maven and IDEA use separate build processes. Ironically I only managed today to get my own app built,deployed and run in browser today using:
Maven 3.0
Tomcat 7.0.5 with tomcat-maven-plugin
IDEA IU version 10
So ask if you need a hand.
Yucca
Sounds like the same bug in the Java VM, I just ran into:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862295
The stated workaround was to use the -XX:+UseParallelGC on the Java VM.
It's not an IDE problem.
That solution was worked for me;
File-->Invalidate Caches-->Tick The Clear CheckBoxes --> Restart
Have a nice day.
Related
I have small problem. I would like to run Intellij Idea with Vaadin and JProfiler on Tomcat.
Everything is fine and works good until I wanted to add profiler to this.
In Eclipse I had
(source: kermeta.org)
And in Idea it is also, but in java SE, Java Eclipse.
I have build project with this tutorial
https://vaadin.com/book/-/page/getting-started.idea.html
and I can not find any place for this program arguments :)
When I run my project in idea it runs only Tomcat and deploys my software on it. And that's it.
Does anybody know where I can put this JProfiler settings to attach to my session in tomcat?
JProfiler has an IDE integration for IntelliJ IDEA. Invoke "Session->IDE Integrations" in JProfiler an choose IntelliJ IDEA.
Then you will get a "Run->Profile" menu entry in IDEA and a toolbar button for profiling the selected run configuration.
Problem solved :)
Install plugin in Intelij Idea 13 and it will integrate with IProfler :)
I have a spring boot application. I use IntelliJ 13.
I want to launch my application in debug mode and debug it. I'm on Windows and I'd like to use shared memory. I would like to just be able to click the debug icon, or a single maven goal, and the application launches in debug mode and the IDE attaches the debugger. This is how I am used to debugging most of my java apps.
However, mixing spring-boot and IntelliJ seems to complicate things. IntelliJ seems to want to connect to the wrong process when I push the green "debug" button and I can't find a way to change the shared memory address that the green 'debug' button's functionality is determined to connect to.
The closest I've come is to add jvmoptions to the maven goal in pom.xml, and then if I add a Remote run configuration, IntelliJ lets me specify a shared memory address that matches what I wrote in the pom. This requires multiple clicks to launch the application and then debug it. It works, in a similar way that using notepad.exe to write code also works. Hence my question.
Is there a 1-step solution using shared memory?
Variation of this question:
Debugging jsp with spring-boot and IntelliJ
However the question and answers are limited to using sockets.
The problem was that IntelliJ was using the Maven goal spring-boot:run as the launch configuration, and trying to debug this causes the debugger to attach to the wrong process.
Setting a new launch configuration of type Application and pointing it at the project's class with the main() method resolves this issue.
Thanks to the commentors for suggesting that this was the way to go about it!
A one click solution (tested on IntelliJ IDEA 14.0.1) using Sockets :
Open Run/Debug Configurations, Add a new Configuration of type Remote
On the Before Lauch panel, add a Run Maven Goal with the command line command:
spring-boot:run "-Drun.jvmArguments=-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
The suspend=n option is important to avoid the Maven Goal to be locked waiting the debugger to connect.
After that you will be able to just lauch this debug task and your app will be launched and the debugger will be attached.
I've just installed Eclipse 4.2.0 and also imported all my old programs into it, except that when I run my programs, it pops up with a message saying:
Select what to run:
Ant Build: Launches an Ant Build with default
Ant Build...: Launches an Ant Build and allows it to be configured
This message has never appeared to me before. I wonder if it is because I imported my files incorrectly or something that I forgot to install. Please tell me how I can make it work properly again. Thanks in advance.
Ah! this is an issue I've experienced earlier. This tip solved the issue. Here's How to do it.
Make sure that you've built it. Or you can enable Project --> Build Automatically.
After the above option is set, try cleaning the workspace. Project --> Clean and clean all the projects you've imported.
Now restart eclipse and you can launch your program.
I'm trying to debug code that I've built from source. It is started with the wrapper from Tanuki.
I'm debugging inside IntelliJ idea but I'm not sure that is the problem.
The debugger correctly stops at all lines where I've put a break point but never else so F8, "step over" doesn't work. Very tiresome as I have to put break points every where :)
Am I doing something wrong?
How do you build the project? If you build it with Ant or some other tool, make sure that compilation is performed with debug info enabled (debug=true for Ant javac task). Obfuscation and bytecode instrumentation during the build can also affect the possibility to debug. If you run under some non-standard JVM, it may also cause such problem.
When performing remote debug, ensure the target process is started with the correct JVM options suggested in the IntelliJ IDEA Remote debug configuration. Your wrapper configuration may pass them incorrectly.
Make sure you don't have a different jar on the classpath (other than the project) with the same classes. You could be stepping through the compiled classes and "breakpointing" in the sources.
This worked for me: http://devnet.jetbrains.com/thread/267022. Basically there's another lib in the classpath confusing the debugger. Simply find out which library it is by stepping into during the debug. Then find it on the project and delete it.
In my case, it was an auto generated file that was causing the confusion.
happened to me as well, on Eclipse (Mars).
Restart of eclipse solved it... as simple as that...
I also faced the same problem.Below trick worked for me:
Delete the settings for Intellij
Windows User :C:\Users{username}.IntelliJIdea14
This will restart the Intellij for you from the beginning.
Hi I also had the same behavior and I got it fixed by installing the latest IntelliJ after removing/rename the folders found in these locations https://intellij-support.jetbrains.com/hc/articles/206544519
I had to delet all the versions I previously installed. Just give it a try.
I'm struggling a bit, trying to properly setup my maven projects in an IDE.
I don't particularly care between Eclipse and IntelliJ, but it seems that IntelliJ handles much better when it comes to import my projects, so I think I will stick with this one.
I'm having other problems now when trying to run the install goal through IntelliJ.
The first error :
The svn command failed. Command output: 'svn' is not recognized as
an internal or external command, operable
program or batch file.
How do I configure IntelliJ in order to let him see svn ? This error sounds weird to me, as I have installed Subversion as my Version Control System in IntelliJ.
Also, and this is related, I have a setenv.cmd that I usually run from the commandLine before calling mvn install. It only sets some variable like :
PROJECT_HOME=d:\Project\xxx\xxx\Trunk
PROJECT_VERSION=0.4.3-SNAPSHOT
M2_HOME=d:\Java\apache-maven-2.0.11
JAVA_HOME=d:\Java\jdk1.5.0_11
PYTHON_HOME=d:\Python26
XOOOF_HOME=d:\Project\xxx\xxx\XOOOF-BIN-1.0.3
XOOOF_URL=file:///d:/Project/xxx/xxx/XOOOF-BIN-1.0.3
SVNCLIENT_HOME=d:\Java\svn-win32-1.6.3
CATALINA_HOME=d:\Java\apache-tomcat
PATH=C:\WINDOWS;C:\WINDOWS\system32
How could I improve this step, and find a way to make it work from my IDE ?
Thanks !
If you want to do maven builds in eclipse I would strongly suggest installing m2eclipse by Sonatype.
It has an excellent reference on how to use it -> http://www.sonatype.com/books/m2eclipse-book/reference/
Regarding the first error it seems to be not Idea fault. AFAIK Idea doesn't need/use external SVN binaries. What happens when you click "9: Changes" tab at the bottom in Idea? If you make your project/module as managed by SVN there should be Repository subtab.
You run Maven from Idea to perform install goal and that error seems to come from it. Do you use SCM/SVN plugin in pom.xml? If yes or you would like to have an ability to run SVN from command line add directory with svn.exe (d:\Java\svn-win32-1.6.3? d:\Java\svn-win32-1.6.3\bin?) to PATH (not only to SVNCLIENT_HOME). After that operation svn command from new "run window" should be recognized.