Define JRE version in maven project definition
When you create new maven project in Eclipse, project is created with java JRE 1.5. If you wish to change that to something else, you need to add compiler plugin with desired JRE source and target version.
In maven project configuration file (pom.xml) add this “maven-compiler-plugin” with setting for source and target version:
More detailed informations …
Refresh Eclipse project
After changing maven project configuration file (pom.xml) you need to refresh eclipse project.
At project level, with right click open Maven submenu and select Update project…
Other sources :
Maven for building Java applications – Tutorial
Ada and GTK+ on windows – hello world sample
Create new project with project wizard. After initial project creation add project dependency to GtkAda.gpr from “gtk ada” installation folder: \GtkAda\lib\gnat\gtkada.gpr.
Or you can simply open project file (file with ‘gpr’ extension) and add “with” statement :
project Gtk2Sample is
type Build_Kind is
LIBRARY_TYPE : Build_Kind := external ("LIBRARY_TYPE");
case LIBRARY_TYPE is
when "static" =>
for Main use ("main.adb");
when "relocatable" =>
“\GtkAda\bin” folder should be in the PATH.
And don’t forget to add special “windows GUI” directives to the linker, go to Project/Properties , under Build/Switches/Ada Linker add this directives in the field :
If you don’t do this, linker will create “windows console application” and additional command line window will always open with your application.
with Gtk.Box; use Gtk.Box;
with Gtk.Label; use Gtk.Label;
with Gtk.Widget; use Gtk.Widget;
with Gtk.Window; use Gtk.Window;
procedure Main is
Win : Gtk_Window;
Label : Gtk_Label;
Box : Gtk_Vbox;
-- Initialize GtkAda.
-- Create a window with a size of 400x400
Win.Set_Default_Size (400, 400);
-- Create a box to organize vertically the contents of the window
-- Add a label
Gtk_New (Label, "Hello from Ada and Gtk !");
-- Show the window
-- Start the Gtk+ main loop
If everything was successful, compile / build will create “main.exe” program file and if you run from inside GPS or from the windows file explorer, only the GTK program window should open.
This is probably minimal GTK project, perfect to learn Ada with graphical interface.
If you have problems with the installation, please check if everything is installed properly… You can find some hints about installation here.