Eclipse Howto

This chapter explains how to use the Eclipse 3.2 IDE with JNode.

Starting

JNode contains several Eclipse projects within a single SVN module. To checkout and import these projects into Eclipse, execute the following steps:

  1. Checkout the jnode module from SVN using any SVN tool you like.
    Look at the sourceforge SVN page for more details.
  2. Start Eclipse
  3. Select File - Import. You wil get this screen.

  4. Select "Existing project into workspace".
  5. Enter the root directory of the imported jnode CVS module in this screen.

    The listed projects will appear when the root directory has been selected.

  6. Select Finish
  7. You will end up with all projects into your Eclipse workspace like this:

Building

You can build JNode within Eclipse by using the build.xml Ant file found in the JNode-All project. However, due to the memory requirements of the build process, it is better to run the build from the commandline using build.bat (on windows) or build.sh (on unix).

Eclipse error: Project 'builder' is missing required library

Hi I'm trying Jnode in eclipse, I want to buitl but, once I imported the project in eclipse this is what I recibe:

Description Resource Path Location Type
The project was not built since it depends on builder, which has build path errors all Unknown Java Problem
The project cannot be built until build path errors are resolved builder Unknown Java Problem
The project cannot be built until build path errors are resolved cli Unknown Java Problem
The project cannot be built until build path errors are resolved core Unknown Java Problem
The project cannot be built until build path errors are resolved distr Unknown Java Problem
The project cannot be built until build path errors are resolved fs Unknown Java Problem
The project cannot be built until build path errors are resolved gui Unknown Java Problem
The project cannot be built until build path errors are resolved net Unknown Java Problem
The project cannot be built until build path errors are resolved shell Unknown Java Problem
The project cannot be built until build path errors are resolved textui Unknown Java Problem
Project 'textui' is missing required library: '/all/lib/classlib.jar' textui Build path Build Path Problem
Project 'shell' is missing required library: '/all/lib/classlib.jar' shell Build path Build Path Problem
Project 'net' is missing required library: '/all/lib/classlib.jar' net Build path Build Path Problem
Project 'gui' is missing required library: '/all/lib/classlib.jar' gui Build path Build Path Problem
Project 'fs' is missing required library: '/all/lib/classlib.jar' fs Build path Build Path Problem
Project 'distr' is missing required library: '/all/lib/classlib.jar' distr Build path Build Path Problem
Project 'core' is missing required library: '/all/lib/classlib.jar' core Build path Build Path Problem
Project 'cli' is missing required library: '/all/lib/classlib.jar' cli Build path Build Path Problem
Project 'builder' is missing required library: '/all/lib/classlib.jar' builder Build path Build Path Problem

I took the code from SVN (revision 5863 the complete trunk directory), but I didn't find classlib.jar, I guess that if I including this jar, I'll be able to buitl Jnode, but i can't find.

Thanks for your help.

ANT build

If you start the ANT build, it will download the classlib: ./build.sh cd-x86-lite

Thanks

Thanks, once I executed the script in the way you said, it build Jnode 0.2.9, in this moment I'm trying jnode 0.2.9 on Qemu.
I opened eclipse again and I refresh the project and the errors disappear.

I have a new doubt, but should I open here or in other place?, It's about a mistake in jnode that it don't let me create a directory in hard disk, the drive it's allow to read and writte but it doesn't works.

this is the line I use for Qemu:

/usr/bin/qemu -monitor stdio -cpu host -k es -vga std -no-kvm-irqchip -no-kvm-pit -no-kvm-pit-reinjection -enable-nesting -m 1024 -no-fd-bootchk -no-acpi -localtime -cdrom /home/ivan/Jnode/Codigo_12102011/trunk/all/build/cdroms/jnode-x86-lite.iso -hda /home/ivan/DD_05 -boot once=d,menu=off -net none -name "Jnode_0.2.9"

something wrong in Qemu's configuration ?

How to avoid out of memory error while building

Note that: this method only resolves the out of memory error while building is initiated by eclipse rather than ant.

Generally, this problem is usually caused by insufficient heap memory configured for jvm. For eclipse, this configuration can be modified by editing eclipse.ini file which is located under the same directory where eclipse.exe lies.

For my laptop which has configured with 2G memory, I used the following config, and it works. (the bold part marked out the significant modification)

-startup
plugins\org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar
--launcher.library
plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.100.v20080509-1800
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
128m
-vmargs
-Xms256m
-Xmx1024m

If you've encountered startup problems, it may indicates that you have insufficient memory. You can try -Xmx600m instead. (In my experiment, compilation will take out at least 547M memory when eclipse is clean started, which means it will take more memory if you have started and used eclipse for a while.)

Tested under eclipse 3.4 (Ganymede)

Good luck pals, and wish you have fun with jnode.

Eclipse Ganymede

With the release of Eclipse Ganymede, it might be possible to simplify this part of setting up a development environment.

1. Install the Subversion plug-in.

2. Install a Subversion Connector.

3. Starting with a new workspace, check out each module using the Subversion plug-in.

CAUTION: When checking out a module, use the Find/Check Out As.. option. It is important to preserve the original module names in your Eclipse workspace.

all instead of JNode-All
core instead of JNode-Core
distr instead of JNode-Distr
docs instead of JNode-Docs
etc..

After checking out modules with Find/Check Out As..., right-click on a project and select Properties... Adjust the Java Build Path properties of each project to reflect the original module names. Replace projects on Projects tab. Replace jars on the Libraries tab.

To compile without an out-of-memory error, use the -Xmx512M -Xms128M arguments for Installed JREs. Go to core project properties | Java Compiler | Errors/Warnings. Enable project specific settings. Ignore tens of thousands of warnings.

Modify the org.jnode.naming.AbstractNameSpace class so that it does not use org.jnode.vm.Unsafe.
try {
// if a service is already bound for that name =>
// notify the listener right now
l.serviceBound(lookup(name));
} catch (NameNotFoundException e) {
// no service bound for that name => ignore
// *D! Unsafe.debugStackTrace(e);
System.out.println("no service bound for that name => ignore");
e.printStackTrace();
}

To run on Windows XP, run org.jnode.emu.ShellEmu as a Java application.

AttachmentSize
shellemu-WindowsXP.PNG26.11 KB

build under eclipse

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

Fabien

my blog (in english and french)