5 Steps to Install Eclipse. We've recently introduced the Eclipse Installer, a new and more efficient way to install Eclipse. It is a proper installer (no zip files), with a self-extracting download that leads you through the installation process. Eclipse setup Step-1: In “Runtime Environment” (here for Tomcat) - JRE must be mapped to the same JRE of JDK in which DCEVM is patched (look at quick start how to setup DCEVM). Step-2: Add “-XXaltjvm=dcevm -javaagent: HotswapAgent.jar' in VM Arguments.
In this article, we're going to run and debug applications on WildFly directly from the Eclipse IDE.
We can use the WildFly application server and Eclipse independently to build and run applications. As a first step, we could start and stop the application server on its own. However, when we integrate them both, development will be quicker. For instance, when we change the code in the debug mode the changes are automatically deployed.
Note the screenshots are taken with Eclipse Photon and they might be different in other versions or operating systems.
First, we start by installing the following software:
Then we verify if everything is properly configured. If both, Eclipse and WildFly, work correctly, then we can continue with our configuration.
3. Installing the JBoss Tools Plugin
We're going to use the JBoss Tools Plugin for Eclipse. JBoss Tools provides, among others, integration between Eclipse and WildFly.
There are two ways to install the plugin:
- We can install it through the website
- We can install it through the Eclipse Marketplace
- Open Eclipse
- Click on Help and then on Eclipse Marketplace
- Search for JBoss Tools
- Click Install next to the JBoss Tools solution
- Follow the rest of the wizard
4. Configuring the Application Server in Eclipse
We start by adding the WildFly server to Eclipse.
First, we add a new View in Eclipse. Please click on the Window/Show View/Other:
Next, please click Server/Servers. Now Eclipse shows a Servers tab:
After that we can add a server by clicking on No servers are available. Click this link to create a new server… in the Servers tab:
In the next step, we expand the JBoss Community category and select the WildFly version that matches with the WildFly installation. For the rest we simply follow the wizard:
Select the newest version when your installed version isn't available. But make sure to upgrade JBoss Tools when they have a new release with support for that specific version:
5. Add an Application to WildFly
After configuring the application server we're going to add an application to the server:
- Right click on the WildFly instance in the Servers tab
- Click Add and Remove
- Select the application to deploy
- Click Add
- Click Finish
The message ‘There are no resources that can be added or removed from the server' is shown if there is a Servlet API version mismatch.
So first we make sure the Servlet API version matches Servlet API version packaged with the WildFly installation:
- Right click on the project
- Click on Properties
- Click on Project Facets
- If the project is not yet in the faceted form
- Click on Convert to faceted form…
- Enable ‘Dynamic Web Module'
After the configuration, we can see the application under the WildFly server instance:
6. Running the Application
We can finally start WildFly and the application from Eclipse. Right click on the WildFly instance and click on Start. The application is starting and we can use it:
We could have achieved the same result by manually deploying the application or using a build tool. However, starting the application server from within the IDE has some advantages such as the possibility to debug the application.
7. Debugging the Application
First, we hit the ‘Stop the server' button (red square) on the Servers or Console tab to stop the server:
Then we start the application in debugging mode by right-clicking on the WildFly instance and then clicking Debug.
When we change the code it's deployed automatically. If we make bigger changes then we get a message from Eclipse telling us to restart. We can also restart the application server manually by right-clicking on the instance and then on Restart in Debug.
Often the source code isn't yet available for the debugger. Resulting in the following message: Source not found. If that's the case we can simply make the source available:
- Click Edit Source Lookup Path
- Click Add
- Select Java Project
- Select the project
- Follow the wizard
In this article, we used the JBoss Tools plugin to integrate WildFly and Eclipse. By combining these tools we can deploy our applications easier.
However, the biggest advantage is that with this setup we can start the application in debug mode and code changes are immediately visible. That way we made our development process faster and more efficient.
Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:>> CHECK OUT THE COURSE
DISCLAIMER: Don't hold me accountable for any bad advice or incorrect information provided here. Use this information at your own risk. I was barely able to hack it together myself and there are still a few details I am not 100% clear on.
For more details about installing MSYS2 check out Install gcc compiler on Windows with MSYS2 for C/C++.
Trying to get an open source toolchain configured in Windows for C++ can sometimes be a headache. In Windows, you can simply install Visual Studio and use the Microsoft C++ compiler, but you may want to use the free GNU compiler (g++) instead. This will outline the process for getting a simple C++ toolchain ready in Windows using Eclipse as an IDE. This guide focuses on the 64 bit version only.
It is important to note that if you install all the MSYS2 development tools first and add the directories to your PATH before running Eclipse and creating a workspace, then Eclipse will be able to find the compiler and tools without having to explicitly set and include directories and will generally work better. I highly recommend setting up the MSYS2 tools and updating your PATH before loading Eclipse.
The toolchain being used is:
- Eclipse C++ (currently Oxygen)
- MSYS2, which provides the MinGW gcc/g++ compiler.
For a compiler we want to use g++, part of the GNU compiler collection (gcc). To get this on Windows we want a minimal system (MSYS) with minimalist GNU for Windows (MinGW) setup. You could use the older MinGW+MSYS tools, but I recommend using MSYS2, which is all I will covere here. MSYS2 comes with the pacman package manager, the same one Arch Linux uses. Simply download the installer and then use the 'MSYS2 MSYS' icon that it creates in the start menu, or run it manually from C:msys64msys2.exe.
After getting in to the MSYS2 bash shell, update everything with:
Then install the base development tools like make and autoconf with the base-devel package and
Optional: Add MSYS2 executables to your Windows PATH
If you want to access everything from your Windows Command Prompt, including vim, pacman, g++, make, and everything else, then add these to your PATH:
Since you already have the compiler toolchain installed and available, you can compile C/C++ project and get coding, but you will likely want to set up an IDE to make things easier. There are many options including NetBeans, Qt Creator, CodeBocks, CLion, Visual Studio Code, Sublime Text, Atom, vim, emacs, etc. Since we are using the free GNU toolchain that is available on several platforms, I recommend using an IDE that is also cross-platform, so you can use the same IDE+compiler across Windows, Mac, and Linux. For this tutorial, I chose Eclipse. It is a very mature IDE, has a good debugger, is heavily customizable and supports many other languages if you choose to commit to it and use it for other languages.
When choosing a project, choose MinGW as the compiler.
Configure environment variables
First set up your environment variables so Eclipse knows where to look for things. It might try to auto detect some of these, but you want to at a minimum make sure your PATH variable includes the directories with make and g++.
Note the path var may already be set if you manually updated your path earlier to add the bin directoriess.
At this point you should be able to compile your program, but the code editor will tell you it can't resolve the standard library symbols like std::cout.
Set up include paths
To fix the unresolved references, Eclipse needs to know where to look for the header file. Have it include the header file for the standardb C++ library in MinGW, by adding the following include path:
Project->Properties->C/C++ Build->Settings->g++ compiler->Includes
Optional: Specify C++ Standards Level
To specify the language level, go to Project->Properties->C/C++ Build->Settings->GCC C++ Compiler->Dialect and choose the appropriate language level, like -std=c++0x
Optional: 32-bit toolchain
To install the 32-bit toolchain, run:
And add the 32-bit toolchain path to your PATH environment variable.
Eclipse Setup For C/c++
Make is already installed with the base-devel package, but if you want to use CMake you need to install it separately from base-devel and toolchain.
At this point, you should have a working toolchain to compile C++ on Windows using Eclipse!