Skip to main content

Portable Eclipse With Java JDK, Tomcat, and PostgreSQL.

How to setup:
Eclipse with Java JDK, Tomcat, and PostrgreSQL
as a portable development environment in Windows.

Download Eclipse IDE for Java EE Developers ( at:
Unzip in C:\eclipse.

Download Java Platform (JDK) 7u1 (jdk-7u1-windows-i586.exe) at:
Unfortunately, it's an exe file so you have to install it, then move the JDK, then uninstall java.
Open explorer to C:\Program Files\Java, then drag the jdk1.7.0_01 folder into C:\eclipse folder.
Edit C:\eclipse\eclipse.ini.
Insert and save this two lines at the VERY TOP:

Download Tomcat 7.0 (under Binary Distributions, Core, as at:

Unzip in C:\eclipse\apache-tomcat-7.0.22.

Now run eclipse.
It will ask you where to save the workspace; save to C:\eclipse\workspace, and check never to ask again.
Click on workbench (top, right).
Click on servers tab (middle tab at bottom window).
Right click on white area, click new, click server.
Click apache, click on tomcat v7.0 server, click next.
Enter for tomcat installation directory: C:\eclipse\apache-tomcat-7.0.22.
Click next

Now run tomcat by clicking on the start the server icon (round green w/ white triagle) or Ctrl+Alt+R.

Now open a browser to http://localhost:8080/ and it should display an HTTP Status 404 error because it's an empty project.  If you did have apps, it gets deployed here: C:\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps which is created when you first run tomcat.

Check here for a how to load an example project and run it:
See the section "Import and Test a Sample App".
Basically, download the to your desktop.
In eclipse, go to File | Import | General | Existing Projects into Workspace | Select archive file by browsing to the desktop and select | and click Finish.
Next, right click on Tomcat server (bottom window) | Add and Remove | select test-app from Available column, click Add > to add to the Configured column | click Finish.
And lastly, run Tocmat, and open your browser to http://localhost:8080/test-app/.

To create a war file for deploying your app, right click on test-app in the Project Explorer window on the left of eclipse | Export | War file | and enter or browse destination for the war file | click Finish.

Download postgresql zipped archive ( at:
for the zip archive linked to
Click on the win x86-32 icon to download the file.
Unzip in C:\eclipse\pgsql.

Create the start-postgres.bat in C:\eclipse, save it, and run it.  It is setup to initialize the posgresql.

When it is done initializing, edit C:\eclipse\start-postgres.bat.
Rem the initdb line like this: REM "%~dp0\bin\initdb" -U postgres -A trust
Unrem pgAdmin3 line like this: %~dp0\pgsql\bin\pgAdmin3
Save it.

To start postgres, just run C:\eclipse\start-postgres.bat.
Close pgadmin3 normally and the batch file will shutdown postgres.

*April 9, 2014: If you get an error due to a missing dll, you'll need to install Microsoft Visual C++ Distributable Package; version 2012 did not work for me, I had to install version 2010 here

Download the jdbc from into C:\eclipse\apache-tomcat-7.0.22\lib.  For jvm 1.7, recommended download:

Run eclipse. Click on Help | Install New Software. Select Work With: Indigo - | click on the + Database Development | check Data Tools Platform Enablement Extender SDK | Finish.

This example jsp page (transaction.jsp) opens, reads, closes a postgresql.
Create a new jsp page in the test-app project.

Run C:\eclipse\start-postgres.bat
Then in eclipse, run tomcat, and open your browser to http://localhost:8080/test-app/transaction.jsp.

In eclipse, you can also connect to the postgres database.
To the top, right of eclipse, click on the Open Perspective icon | Other | Database Development | Ok.
To the left window, right click on Database Connections | New | click on PostgreSQL | change Name: to AAT PostgreSQL | Next
Click on the New Driver Definition icon to the left of the Drivers box.
In the Name/Type tab, click on the PostgreSQL JDBC Driver in the Available driver templates, and change the Driver Name: PostgreSQL9 JDBC Driver.
In the JAR List tab, Remove all the Driver Files, then click Add JAR/Zip, navigate to apache-tomcat-7.0.22\lib and click on our postgres driver (postgresql-9.1-901.jdbc4.jar), and Open.
In the Properties tab, change to these:

Database:  aat
URL: jdbc:postgresql:aat
User name: aat
Password: letmein
check checkbox for Save password
Click OK
Click Finish
If all went well, in the Data Source Explorer window (left of eclipse), under Database Connections you should see the AAT PostgreSQL and below that the aat database which lets you navigate to the aat tables, data, etc.


udegram said…
C: drive is normally not included in the access rights of a common domain user. C:\Temp is accessible to the user. How can I use C:\Temp\eclipse to get it working?
When I relocated eclipse folder from C:\ to C:\Temp, I get the following error.
The archive: C:/eclipse/apache-tomcat-7.0.61/bin/bootstrap.jar which is referenced by the classpath, does not exist.

What's the fix?