Forum: Building APIs & Wire Protocol

Post: Using Eclipse

Using Eclipse
tuancao
Jun 3, 2010
Hi,
I checked out: svn checkout http://svnmirror.voltdb.com/eng/trunk/
and tried to follow the document developer_tools (under trunk/doc) Getting Started in Eclipse


3. Go to the project's Properties > Java Build Path > Source.
4. Link the following src dirs:
- `gpl_src`
- `hzsqldb_src`
- `hzsqldb_test_src`
- `mit_src`
- `mit_test_src`


I could not find the mentioned above directories (gpl_src,hzsqldb_src,...).
Can you tell me where the src dirs are located?


Thanks,
Tuan
That readme is out of date.
rbetts
Jun 3, 2010
That is an old readme. I apologize for the confusion. We'll clean this up.


But the good news is creating an eclipse project is easy these days.

Step 1: In the root directory of your svn checkout, you will find a file, template.classpath. This is a template of a standard eclipse .classpath file. Copy this file to a new file named .classpath. Open the .classpath file in the editor of your choice. Change the first path element of attributes/attribute/@value to match the name of your VoltDB checkout directory. For example, if you typed "svn checkout http://svnmirror.voltdb.com/eng/trunk/ voltdb", you would change "trunk/obj/release/nativelibs" to "voltdb/obj/release/nativelibs". Save this change. Exit the editor.


Step 2: Build the full project using the "ant default" command from the root directory of your checkout. This will build the JNI shared library.


Step 3. Start eclipse. Create a new Java project from existing sources. Eclipse will find your new .classpath file and correctly read the right buildpath and project directories. Just click through the next/finish buttons to finish the project wizard.
Hi, Could you send me the
tuancao
Jun 3, 2010
That is an old readme. I apologize for the confusion. We'll clean this up.


But the good news is creating an eclipse project is easy these days.

Step 1: In the root directory of your svn checkout, you will find a file, template.classpath. This is a template of a standard eclipse .classpath file. Copy this file to a new file named .classpath. Open the .classpath file in the editor of your choice. Change the first path element of attributes/attribute/@value to match the name of your VoltDB checkout directory. For example, if you typed "svn checkout http://svnmirror.voltdb.com/eng/trunk/ voltdb", you would change "trunk/obj/release/nativelibs" to "voltdb/obj/release/nativelibs". Save this change. Exit the editor.


Step 2: Build the full project using the "ant default" command from the root directory of your checkout. This will build the JNI shared library.


Step 3. Start eclipse. Create a new Java project from existing sources. Eclipse will find your new .classpath file and correctly read the right buildpath and project directories. Just click through the next/finish buttons to finish the project wizard.


Hi,


Could you send me the updated README file?


I tried Step1 and Step2, it worked fine.


But for Step 3, after I created the project from existing source. It gave many errors. For example:
tools/cli
(default package)
VoltdbCli.java


package cli: the error says: the declared package "cli" does not match the expected package ""


There are several errors like that one (for example: at src/proj_gen, tools/lbd_lock_test,....)
Could you please check out a fresh version from trunk and try step 3 again?


Thanks,
Tuan
.. and to answer your actual question
rbetts
Jun 3, 2010
Oops. I re-read your question and realized you might not be asking about eclipse. The directory structure is pretty straight forward. If you checked out http://.../trunk to a directory named voltdb, for example:


voltdb/src/frontend -- the transaction management and messaging layers (Java)
voltdb/src/ee -- the SQL and storage layers (CPP)
voltdb/tests -- parallels the src directory and contains testcases.


We build with the ant tool. By default, all object files are written to voltdb/obj/release. If you create a debug build (ant -Dbuild=debug default), the resulting files are written to obj/debug.