Build & development environment

This chapter details the environment needed to setup a JNode development environment.

Sub-Projects

JNode has been divided into several sub-projects in order to keep it "accessible". These sub-projects are:

JNode-All The root project where everything comes together
JNode-Core The core java classes, the Virtual Machine, the OS kernel and the Driver framework
JNode-FS The Filesystems and the various block device drivers
JNode-GUI The AWT implementation and the various video & input device drivers
JNode-Net The Network implementation and the various network device drivers
JNode-Shell The Command line shell and several system commands

Each sub-project has the same directory structure:

<subprj>/build All build results
<subprj>/descriptors All plugin descriptors
<subprj>/lib All sub-project specific libraries
<subprj>/src All sources
<subprj>/.classpath The eclipse classpath file
<subprj>/.project The eclipse project file
<subprj>/build.xml The Ant buildfile

Eclipse

JNode is usually developed in Eclipse. (It can be done without)
The various sub-projects must be imported into eclipse. Since they reference each other, it is advisably to import them in the following order:

  1. core
  2. shell
  3. fs
  4. gui
  5. net
  6. builder
  7. distr
  8. all
  9. sound
  10. textui
  11. cli

For a more details please have a look at this Howto.

IntelliJ IDEA

JetBrains Inc has donated a Open Source License for Intellij IDEA to the dedicated developers working on JNode.

Developers can get a license by contacting Martin.
Setup of the sub-projects is done with using the modules feature like with Eclipse.

One should increase the max memory used in the bin/idea.exe.vmoptions or bin/idea.sh.vmoptions file, edit the -Xmx line to about 350mb. IntelliJ can be downloaded at http://www.jetbrains.com/idea/download/ Use at least version 5.1.1. Note that this version can import Eclipse projects.

Requirements for building under Windows

  1. Make sure that you have a Sun JDK for Java 1.6.0 at or near the most recent patch level. (Some older patch levels are known to cause obscure problems with JNode builds.)
  2. Make sure that the pathname for the root directory your JNode tree contains no spaces. (Spaces in the pathname are likely to break the build.)
  3. Create a "bin" directory to holds some utilities; see below.
  4. Use the "System" control panel to add the "bin" directory to your windows %PATH%.
  5. Download the "nasm" assembler from http://nasm.sourceforge.net. (Make sure that you get the Win32 version not the DOS32 version!)
  6. Open the downloaded ZIP file, and copy the "nasm.exe" file to your "bin" directory. Then rename it to "nasmw.exe".

Now, can start a Windows command prompt, change directory to the JNode root, and build JNode as explained the next section.

Requirements for building under Linux

  1. Make sure that you have a Sun JDK for Java 1.6.0 at or near the most recent patch level. (Some older patch levels are known to cause obscure problems with JNode builds.)
  2. Make sure that the 'nasm' assembler is installed. If not, use "System>Add/Remove Software" (or your system's equivalent) to install it.

Building

Running "build.sh" or "build.bat" with no arguments to list the available build targets. Then choose the target that best matches your target environment / platform.

Alternatively, from within Eclipse, execute the "all" target of all/build.xml. Building in Eclipse is not advised for Eclipse version 2.x because of the amount of memory the build process takes. From Eclipse 3.x make sure to use Ant in an external process.

A JNode build will typically generate in the following files:

all/build/jnodedisk.pln A disk image for use in VMWare 3.0
all/build/x86/netboot/jnodesys.gz A bootable kernel image for use in Grub.
all/build/x86/netboot/full.jgz A initjar for use in Grub.

Some builds also generate an ISO image which you can burn to disk, and then use to boot into JNode from a CD / DVD drive.

please write building process under eclipse3x+windowsxp

i have some question:
1,i import jnode root dir ,include all,core,shell,etc;but no build.xml files in root dir(for example:d:\jnodesource)
2,i copy nasm,mkisof,cy*1.dll to \system32,than build all target
3,there will have more than 4000 warning,no error;thanks god
4,but no all/build/jnodedisk.pln all/build/x86/netboot/jnodesys.gz all/build/x86/netboot/full.jgz;
5,no build dir in jnode-all,but have build dir in other dir;

please please please help me

Ant

You must use Ant to build complete system with following command line :

ant -Djnode.compiler=l2 cd-x86-lite

Fabien L.

how to add this config in eclipse?

thanks for you help,but i dont know how to add "ant -Djnode.compiler=l2 cd-x86-lite" under eclipse3.2

can you tell me the details,thanks!

Building under Windows

To build under windows, you need to download :
- nasmw on sourceforge.
- mkisofs from cygwin : you only need mkisofs.exe and cygwin1.dll from their packages.

Put nasmw, mkisofs.exe and cygwin1.dll in your PATH or in C:\windows\system32\.

Now, you can build JNode as explained above.

build under eclipse 3

Here is how to solve the OutOfMemoryError exception under eclipse 3 :

- select menu Run -> External Tools -> External Tools ...

- on the left side, select a child of the node named "Ant build" (or create a new one)

- on the right side, select the JRE tab and add -Xmx512M -Xms128M in VM arguments

This comment needs to go in the documentation

Home -> Books -> Documentation -> Technical Documentation -> Build Process

This part of the documentation deals with importing projects into eclipse, and how to run the build process from eclipse. It does not however suggest to change these settings. For someone who has used JNode for quite a while it is known that these settings must be changed, but for someone starting out it could be frustrating.

Could you add this text to the documentation? Or could Ewout do it? Or with permission I will add it in.

Matt.

Add new comment

Hallo Matt,

first excuse my bad english, I have a simple question, can I use the netbeans to written Java Tools for JNode, or must I use the Eclipse.

Best Wishes from Germany Rudy

you can use something else than eclipse

Hi rudy,

On CVS, there is a configuration for the workspace of eclipse and for intellij IDEA.
But you can use the IDE you want or no IDE at all and compile from the command line (see build.sh and build.bat scripts).

Fabien

my blog (in english and french)

I agree with you, but I can't add it to the documentation

I agree with you, but I see no mean to add it directly to the documentation (perhaps I don't have sufficient privileges). So, I added it as a comment.

A suggestion, other basic help like this could be usefull for beginers in JNode developpement (like me). So if you have time, you should add it to the documentation, because more new developpers could be attracted by JNode if it's easy to start developping (But I don't spend so much time to start).

I agree, but i have only just installed Eclipse 3

Also, I liked the way you put it. So I did not want to step on your foot and copy/paste your contribution and claim it for myself.

Lately I have not had much time to do any work on JNode, perhaps this will change very soon, but I'm finding it difficult where to start into it again.

Matt.

What does netbeans build to?

I opened the netbeans project but dont have a clue what it builds to.

Command line

You need to build the project from the command line with the following command :

sh build.sh clean cd-x86-lite
or
build.bat clean cd-x86-lite

Be sure that all dependencies are installed like java, ant and nasm.

Fabien L.