Jump to content

Debugging With Intellij Idea


Recommended Posts

I will teach you how to fix your java bugs, a lot more effectively.
What you will need: https://www.jetbrains.com/idea/
 
First i will show what you will be able to do, and at the end how to set it up.
 
1. Setting Break Points:
QhGc2Dk.png
 
When JVM will reach the breakpoint, whole game will freeze(so just use it on your test server) and you will be able to see:
- Stacktrace(it tells you the path that JVM passed to reach the Break Point)
41y7Du4.png
 
- Variable values(you can change however you like)
dBqHIAO.png
 
- You can setup the Watches(if you have got access to the object, you can take look for its content)
JHxOIyp.png
 
- You can run any code fragment you like
KpsPdHq.png

 
2. You can make Break Point stop, only when condition returns true
euc4JGG.png
 
3. You can log messages to the IDE console without suspending the thread
wHgue3d.png
 
 
How to install it?
JDncjR9.png
 
1. Click Run > Edit Configurations
2. Add new Remote(we are setting up gameserver that will run on our pc, it is called remote because it is not started by IDE)
3. Set the name, click Shared Memory + Attach mode(Listen can be useful sometimes, but its faster to run the server with Attach mode), set the port(i use ports from 5005-5015)
4. Edit your StartGameServer.bat. After java add "-agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=5007"
5. Run your server
6. In IDE click Run > Debug 'GameServer'

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...