<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IDE &#8211; CodePills.com</title>
	<atom:link href="https://codepills.com/tag/ide/feed/" rel="self" type="application/rss+xml" />
	<link>https://codepills.com</link>
	<description>Helping you make a better code</description>
	<lastBuildDate>Sat, 23 Mar 2024 08:42:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>3 ways how to kill Spring Boot application at port 8080 on Windows</title>
		<link>https://codepills.com/3-ways-how-to-kill-spring-boot-application-at-port-8080-on-windows/</link>
					<comments>https://codepills.com/3-ways-how-to-kill-spring-boot-application-at-port-8080-on-windows/#respond</comments>
		
		<dc:creator><![CDATA[Andrej Buday]]></dc:creator>
		<pubDate>Wed, 03 Feb 2021 17:47:12 +0000</pubDate>
				<category><![CDATA[Bug hunt]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IntelliJ Idea]]></category>
		<category><![CDATA[PID]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[process ID]]></category>
		<category><![CDATA[server container]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring Boot]]></category>
		<category><![CDATA[Spring Boot application]]></category>
		<category><![CDATA[Spring development]]></category>
		<category><![CDATA[terminal]]></category>
		<guid isPermaLink="false">https://codepills.com/?p=1132</guid>

					<description><![CDATA[This article is a simple tutorial on how to kill your Spring Boot application which occupies port 8080 on Windows <a href="https://codepills.com/3-ways-how-to-kill-spring-boot-application-at-port-8080-on-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This article tries to answer one of the most often occurred questions connected with Spring Boot development. When developing a web application with Spring Boot, you might hit an error announcing that port 8080 is occupied. In this article, we will see why and how to solve this error. However, be sure that tutorial can help you solve the occupancy of any other port.</p>
<p><span id="more-1132"></span></p>
<h2>Spring Boot application default port</h2>
<p>When you develop long enough with Spring Boot, you know the error very well. You work on your Spring Boot application, and you use a console for running the application. Or you use your favourite IDE runner for starting your application (my preferred IDE is IntelliJ IDEA). Your Spring Boot application in the running embedded in servlet container when suddenly you need to do something else. Instead of adequately terminating the embedded servlet container with your application, you detach from the servlet by a closing terminal window or switching to a different project in IDE. However, because you did not correctly terminate your IDE runner and did not correctly kill the terminal&#8217;s application process, the servlet with the application is still running. After that, you might, of course, start developing something else. Surprise, surprise, you cannot. Any Spring Boot application port, by default number 8080, is still occupied with the unterminated process of your Spring Boot servlet container. (In the tutorial, we assume you are using the Spring Boot application port on default port number 8080).</p>
<p>I guess you might be a little bit confused by all the wording describing the issue. Let&#8217;s take a look first at some terminology to understand the problem here fully:</p>
<h3>What is process?</h3>
<p>We are aware that readers of this blog are pretty skilled in computers. So, we will provide a brief description of what is computer process without going to further details.</p>
<p>Every time you start a program on your computer, it requires a certain amount of resource. Your Central Processor Unit, known as CPU, add to this program its process.</p>
<p>If you open task manager on your Windows, you will see a list of all process your CPU is trying to manage at once.</p>
<h3>What is process ID?</h3>
<p>The process ID, also known as PID, is the number assigned by the operating system to each new process.</p>
<h3>What is port number?</h3>
<p>A port number is how to identify individual processes for network message when they arrive on a server. In a real sense, a port number is the logical address of each application or process that helps identify the sender and receiver of processed messages. </p>
<p>You can imagine port numbers as doors in the hallway into which message flows through the networks. It leaves one door and enters another.</p>
<h3>What is Spring Boot server container?</h3>
<p>Spring Boot is a Spring project which makes Spring development fast. Without going too much into the Spring Boot project details, your Spring Boot application runs in a server container, better known as a servlet. This servlet runs in one computer process and lister on port 8080 for traffic.</p>
<h2>Restart computer</h2>
<p>One way how to solve this is to restart your computer. During the restart of Windows OS, start all the fresh, and port 8080 will be empty. But this is not the fastest and definitely not the right way for developers to solve this.</p>
<h2>Set different port number</h2>
<p>Another way is to solve this issue by assigning the Spring Boot application a different port number. When we set a different port number for the application, we will not kill the existing process with the application servlet container. However, we will create a new-different process for the servlet container, which will be listening on a different port. In this way, port 8080 will be still occupied, but we will at least be able to continue to develop.</p>
<p>Go to Spring Boot <code>application.properties</code> file and set different port number for <code>server.port</code> .</p>
<p>Despite this quick workaround, there is a much more mature way to solve this problem. I would like you to show a better way to kill a Spring Boot servlet container listening on port 8080.</p>
<h2>Kill the process listening at port 8080</h2>
<p>To kill the process listening at port 8080 in the Windows environment, we need only go through a few steps. First, check the image below to get the idea.</p>
<p><img fetchpriority="high" decoding="async" src="https://codepills.com/wp-content/uploads/2021/02/kill_process_at_port_8080_on_the_windows_10.png" alt="How to kill process listening at port_8080 on the Windows 10" width="623" height="198" class="size-full wp-image-1133" srcset="https://codepills.com/wp-content/uploads/2021/02/kill_process_at_port_8080_on_the_windows_10.png 623w, https://codepills.com/wp-content/uploads/2021/02/kill_process_at_port_8080_on_the_windows_10-300x95.png 300w" sizes="(max-width: 623px) 100vw, 623px" /></p>
<h3>Find the process occupying port 8080</h3>
<p>On the Windows, open your CMD terminal. With simple command <code>netstat  -ano  |  findstr  PORT_NUMBER</code>, where for PORT_NUMBER add port number 8080, and on command prompt output (hit enter), we will get the <b>process id</b> of process <strong>listening on port 8080</strong>.</p>
<h3>Kill the process with command prompt</h3>
<p>Now, all we need to do is just type the following command <code>taskkill  /F  /PID  PROCESS_ID</code> and replace PROCESS_ID by the <b>process id</b> we got from the previous command result.</p>
<p>If you have typed everything correctly, process listening on port 8080 should be terminated.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codepills.com/3-ways-how-to-kill-spring-boot-application-at-port-8080-on-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to remotely debug Java application in IntelliJ</title>
		<link>https://codepills.com/how-to-remotely-debug-java-application-in-intellij/</link>
					<comments>https://codepills.com/how-to-remotely-debug-java-application-in-intellij/#respond</comments>
		
		<dc:creator><![CDATA[Andrej Buday]]></dc:creator>
		<pubDate>Mon, 01 Feb 2021 20:52:52 +0000</pubDate>
				<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[bytecode]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IntelliJ Idea]]></category>
		<category><![CDATA[JAR]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[maven build]]></category>
		<category><![CDATA[monolith]]></category>
		<category><![CDATA[port exhaustion]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[session exhaustion]]></category>
		<category><![CDATA[Slack]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[war]]></category>
		<guid isPermaLink="false">https://codepills.com/?p=1122</guid>

					<description><![CDATA[This article is a simple tutorial on how to debug your JAR or WAR file remotely. <a href="https://codepills.com/how-to-remotely-debug-java-application-in-intellij/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This tutorial will show you how to debug your JAR or WAR file in IntelliJ IDEA remotely and give hints on developing new features through the application stack.</p>
<p><span id="more-1122"></span></p>
<h2>Prerequisites</h2>
<p>Let me give you some essential tips for prerequisites to get successful and smooth remote debugging.</p>
<h3>Debug same version as on the remote server</h3>
<p>To debug a remote server-side application in your IntelliJ IDEA, you need to have the same version of your application or component on your side in IntelliJ IDEA as on the server-side. To do so, you shall first finish all the changes you want to test on the remote server. Then build your application and deploy it to the remote server. Only then you should run remote debug mode against your remote environment.</p>
<p>In reverse, if you can not change what is on the server, rebase your code repository on the commit of the JAR or WAR file set on the server. Then, build the application with the build tool of your choice (Maven/Gradle), and only then can you remotely debug.</p>
<h3>Don&#8217;t make any additional changes before remote debug</h3>
<p>Writing the following note might be unnecessary, yet it is better to say it aloud as a reminder. If you make any changes in your code between deployment on the remote server and running the application in remote debug mode, remote debug will not work. Even on the slightest change, remote debug will not decompile your breakpoint on the desired code line because Java bytecode will be different.</p>
<h3>Build faster without tests</h3>
<p>Just a tip &#8211; for a fast Maven build you can use <code>mvn clean install -DskipTests</code>.</p>
<p>For more information regarding running a Maven build without tests, check the article about <a href="https://codepills.com/how-to-build-with-maven-without-running-tests/" title="How to build with Maven without running tests" target="_blank" rel="noopener">how to build Java application with Maven without running tests</a>.</p>
<h3>Coordination your work with the rest of the team</h3>
<p>If you are working in a team and want to be a good team player (or working on something very sensitive), let your teammates know you want to deploy and remotely debug your application. First, ask your colleagues, e.g. in Slack publicly, if it is OK to occupy test instance for a while. Then, coordinate your debugging according to the response or your organization&#8217;s policy. For example, let&#8217;s say you are clear to go if nobody responds in 15 minutes.</p>
<h3>Adjustment of other parts</h3>
<p>For more complex changes through the stack, changing and adjusting different system parts might be necessary. E.g., if you are working on the monolith, you might need to adjust the front-end client for testing purposes. In other cases, it might be necessary to change the database.</p>
<p>Adjusting other parts of the system might be necessary for the system to work and for you to be able to test changes through the whole stack.</p>
<p>In every case, do not forget to clean after yourself when leaving (check the last point of this tutorial for more info).</p>
<h2>1. In IntelliJ IDEA, create new Run/Debug Configuration for Remote JVM Debug</h2>
<p><img decoding="async" src="https://codepills.com/wp-content/uploads/2021/02/remote_debug_in_intellij_idea.png" alt="Remote Debug in IntelliJ IDEA" width="752" height="745" class="size-full wp-image-1123" /><br />
<i style="text-align: center;">Example of setup in IntelliJ IDEA</i></p>
<p>You can change host and port configurations based on the remote environment you want to debug.</p>
<p>If using a multi-module project, select a module in <code>Use module classpath</code>.</p>
<h2>2. Run remote debug configuration in debug mode</h2>
<p>Connecting to the host should be nearly instant. So now, all you need to do is place the <strong>breakpoints</strong> in your code.</p>
<p>Then, when the application code executes in a connected environment, the line you set as the breakpoint should be reached, and IntelliJ IDEA will show you the stack trace. That is it, simple as that.</p>
<h2>3. Do not forget to close your debug session</h2>
<p>Do not forget to close your debug session. Unclosed sessions cause port/socket exhaustion and lead to server restart. Also, try not to keep the session open and be stuck on the breakpoint for too long. <i>TimeOutException</i> and other exceptions might occur which will lead to further server resource consumption.</p>
<h2>4. Clean up</h2>
<p>After successful testing, returning the testing environment to its original state might be necessary. For example, build your current master/develop branch and place it back in the test environment. Then, if your colleagues do not notice that the testing environment does not work as it should, you did a good job cleaning after yourself and placing the project back in a stable state.</p>
<p>If you are on your own, I highly recommend cleaning after yourself too. You will never know when you will need to return to your projects again, and you might not remember why the testing environment is in a different state at that time.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codepills.com/how-to-remotely-debug-java-application-in-intellij/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use IntelliJ Idea as a text editor</title>
		<link>https://codepills.com/how-to-use-intellij-idea-as-a-text-editor/</link>
					<comments>https://codepills.com/how-to-use-intellij-idea-as-a-text-editor/#respond</comments>
		
		<dc:creator><![CDATA[Andrej Buday]]></dc:creator>
		<pubDate>Fri, 01 Jan 2021 15:25:33 +0000</pubDate>
				<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Grammarly]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IntelliJ Idea]]></category>
		<category><![CDATA[IntelliJ Idea IDE]]></category>
		<category><![CDATA[Microsoft Word]]></category>
		<category><![CDATA[text editor]]></category>
		<category><![CDATA[word processor]]></category>
		<guid isPermaLink="false">https://codepills.com/?p=1104</guid>

					<description><![CDATA[This article will give you a few excellent tips on how and why to turn your favourite IDE into your first choice text editor. <a href="https://codepills.com/how-to-use-intellij-idea-as-a-text-editor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I have recently started to use IntelliJ Idea as my text editor and integrated it into my creative process.</p>
<p><span id="more-1104"></span></p>
<p>As I am a software developer, IntelliJ IDE is, for me, a must. IDE is in front of me opened all the time. Therefore it is a chance for me to write a lot of content in the IDE.  It is a better choice to use IDE instead of switching to another text editor or using another means of word processing.</p>
<p>Since I am also aiming to work on several articles or documents simultaneously, every decrease in ambiguity and complexity counts towards faster results. The creative process is not possible to automatize. But what it is possible to automatize are redundant tasks during text handling and editing.</p>
<h2>Why turn IntelliJ Idea IDE into your word processor?</h2>
<p>First of all, IntelliJ Idea IDE already comes in its 2020 version with very, very good support for English vocabulary. So writing in English in IDE was never easier than now.</p>
<p>Plus, when implementing the advantage of multiple IntelliJ shortcuts, the word processing is swift. Especially if you write your text in .html, .adoc or .md format.</p>
<p>Overall, IntelliJ IDE comes in all versions with Git support, which is an additional advantage against traditional word processors. You can easily version your articles&#8217; state and keep a history of your edits in one place. Article versioning is a feature that is available only in very advanced mode in cloud SaaS.</p>
<p>However, what I have found very tedious was text formatting in IntelliJ. As expected, I was using IntelliJ Idea IDE for coding, mostly Java, and thus the text was supposed to be wrapped automatically after 120 characters. When I then copied my articles to other word processors in my pipelines, such as Microsoft Word or Grammarly, I always needed painfully deleted every single break line to make a single continuous line of text. That was also one of the most common mistakes I had after publishing articles through WordPress  &#8211; linebreaks were always in places where they should not be.</p>
<p>After enough time spent doing this pointless work, fixing many wrong break lines, I have decided to end it and figure out how to speed up the process. Because every second I spend editing an article is second, I could use it towards another article&#8217;s creative process.</p>
<h2>How to turn IntelliJ Idea into text editor?</h2>
<p>First of all, go to <i>Settings</i> > <i>Editor</i> > <i>General</i> and check all checkboxes in Soft Wraps section.</p>
<p><img decoding="async" src="https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_checkboxes_in_general_editor_settings.png" alt="IntelliJ soft-wrap checkboxes_in_general editor settings" width="692" height="361" class="size-full wp-image-1106" srcset="https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_checkboxes_in_general_editor_settings.png 692w, https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_checkboxes_in_general_editor_settings-300x157.png 300w" sizes="(max-width: 692px) 100vw, 692px" /></p>
<p>Then go to <i>Settings</i> > <i>Code Style</i> and select Scheme Project. Here unselect the checkbox &#8220;Wrap on typing&#8221;.</p>
<p><img loading="lazy" decoding="async" src="https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_editor_code_style.png" alt="IntelliJ soft-wrap editor code style" width="807" height="422" class="size-full wp-image-1105" srcset="https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_editor_code_style.png 807w, https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_editor_code_style-300x157.png 300w, https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_editor_code_style-768x402.png 768w" sizes="(max-width: 807px) 100vw, 807px" /></p>
<p>I would recommend this change be saved under the current project scheme, not under the IDE scheme. If you are using the same IntelliJ for coding, wrapping will conflict with your code clarity if you save the change under the IDE scheme.</p>
<p>Hit Apply button to apply all the changes.</p>
<h3>Initialize soft-wrap in IntelliJ code editor</h3>
<p>In the active editor tab, on the left side of the text line panel, after the right-click, there is an option <code>soft-wrap</code> to initiate the wrapping. Soft-wrap is not initialized automatically on every new file open. Therefore you will need to initialize soft-wrap on every new file open.</p>
<h3>Tip for shortcut</h3>
<p>When you open a new file, the text is, by default, unwrapped. You can either right-click on the newly opened line meter on the left side and hit <code>Soft-Wrap</code> from the menu option. Or you can set up a special shortcut for soft-wrapping, while the shortcut is not set by default.</p>
<p><img loading="lazy" decoding="async" src="https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_custom_shortcut.png" alt="IntelliJ soft-wrap - custom shortcut" width="645" height="395" class="size-full wp-image-1107" srcset="https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_custom_shortcut.png 645w, https://codepills.com/wp-content/uploads/2021/01/intellij_soft-wrap_custom_shortcut-300x184.png 300w" sizes="(max-width: 645px) 100vw, 645px" /></p>
<p>To set up your shortcut, go to <i>File</i> > <i>Settings</i> > <i>Keymap</i> and search for &#8220;Soft-Wrap&#8221; in <i>Main Menu</i> > <i>View</i> > <i>Active Editor</i>. Add to action key shortcut. I personally use Alt + P key shortcut. That is not a conflicting key shortcut with keys combinations easy to remember.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codepills.com/how-to-use-intellij-idea-as-a-text-editor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
