Difference between revisions of "How to build Freeplane"

From Freeplane - free mind mapping and knowledge management software
(Created page with '== How to check out Freeplane and use svn == ok, first step is to get a svn client; this is the program you need for checking out of a central repository - the one where we all ...')
 
Line 1: Line 1:
== How to check out Freeplane and use svn ==
+
== How to check out Freeplane and use svn ==
  
ok, first step is to get a svn client; this is the program you need
+
ok, first step is to get a svn client; this is the program you need for checking out of a central repository - the one where we all work together.  
for checking out of a central repository - the one where we all work
 
together.
 
  
you need to understand what 'commit' and 'update' means, there are
+
you need to understand what 'commit' and 'update' means, there are many hello world tutorials for svn in the net  
many hello world
 
tutorials for svn in the net
 
  
(by the way, 'svn' stands for 'subversion', this is also the name of a
+
(by the way, 'svn' stands for 'subversion', this is also the name of a command line program if you have installed the svn client.)  
command line program if you have installed the svn client.)
 
  
READ: http://subversion.tigris.org/faq.html
+
READ: http://subversion.tigris.org/faq.html  
  
especially try to understand what is going on in
+
especially try to understand what is going on in  
  
http://subversion.tigris.org/faq.html#co-svn
+
http://subversion.tigris.org/faq.html#co-svn  
  
after reading the example, you can try that out in your svn client
+
after reading the example, you can try that out in your svn client (either plain cli program svn, tortoisesvn which is a gui for the same functionality integrated in the file explorer) and check out the code from freeplane.  
(either plain cli program svn, tortoisesvn which is a gui for the same
 
functionality integrated in the file explorer) and check out the code
 
from freeplane.
 
  
There is also a web interface for better svn browsing:
+
There is also a web interface for better svn browsing:  
  
http://freeplane.svn.sourceforge.net/viewvc/freeplane/
+
http://freeplane.svn.sourceforge.net/viewvc/freeplane/  
  
(insert the url directly in your browser, see what happens!)
+
(insert the url directly in your browser, see what happens!)  
  
the files you'll get are locally saved copies from the central
+
the files you'll get are locally saved copies from the central repository. you can change them as you like, edit files, delete files, even directories - svn will track what you've done and eventually you can 'commit' the files again, which means you want to put your local changes to the central repository.  
repository. you can change them as you like, edit files, delete files,
 
even directories - svn will track what you've done and eventually you
 
can 'commit' the files again, which means you want to put your local
 
changes to the central repository.
 
  
You don't need to check out whole projects, subversion can also just
+
You don't need to check out whole projects, subversion can also just checkout a directory, or a subset of directory trees.  
checkout a directory, or a subset of directory trees.
 
  
Try
+
Try  
  
svn co https://freeplane.svn.sourceforge.net/svnroot/freeplane/freeplane_program/trunk/freeplane/resources/images
+
svn co https://freeplane.svn.sourceforge.net/svnroot/freeplane/freeplane_program/trunk/freeplane/resources/images  
  
for example: it will create the directory of images you want dimitry
+
for example: it will create the directory of images you want dimitry to put them 'in the main thing which saves our "code"'. This is it, plain and simple.  
to put them 'in the main thing which saves our "code"'. This is it,
 
plain and simple.
 
  
Only if you want to change something centrally, you'll have to get a
+
Only if you want to change something centrally, you'll have to get a username and a password for that.  
username and a password for that.
 
  
Of course, if you use eclipse with the subversion plugin, checking out
+
Of course, if you use eclipse with the subversion plugin, checking out projects is very easy. you can also try www.netbeans.org, which does it perfectly well also.  
projects is very easy. you can also try www.netbeans.org, which does
 
it perfectly well also.
 
  
concerning your problems: seems like you've tried to add metadata
+
concerning your problems: seems like you've tried to add metadata stored in .svn directories which typicaly happens if you download 'somehow' the whole archive (means: without a client). the data in the .svn directories manage the whole 'versioning' process, but this data mustn't be commited, added or updated, its the task of your svn client to do so.  
stored in .svn directories which typicaly happens if you download
 
'somehow' the whole archive (means: without a client). the data in the
 
.svn directories manage the whole 'versioning' process, but this data
 
mustn't be commited, added or updated, its the task of your svn client
 
to do so.
 
  
again, there are many svn howtows out there, read
+
again, there are many svn howtows out there, read  
  
http://paulstamatiou.com/how-to-subversion-basics
+
http://paulstamatiou.com/how-to-subversion-basics  
  
where sb uses a command client svn. google for svn howto, subversion basics etc.
+
where sb uses a command client svn. google for svn howto, subversion basics etc.  
  
 
BUT: using svn is tricky sometimes ...
 
BUT: using svn is tricky sometimes ...
 +
 +
== How to compile freeplane ==
 +
 +
here is a short cookbook how to compile freeplane:
 +
 +
(assuming you have checked out the newest code via SVN ;) )
 +
 +
open a cli (on windows this can be done via <windows key> + r ( a window pops up)
 +
and you enter 'cmd')
 +
 +
then you have a command line interface. (there are various again, if you want a decent cli use cygwin.com albeit this is not necessary atm)
 +
 +
enter:
 +
 +
java -version
 +
 +
something like this should be displayed:
 +
 +
$ java -version
 +
java version "1.6.0_10-beta"
 +
Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
 +
Java HotSpot(TM) Client VM (build 11.0-b12, mixed mode, sharing)
 +
 +
if this doesn't appear, check your JAVA installation (please follow the steps in the readme files thorougly) - go to java.sun.com and get the latest distribution.
 +
 +
 +
then, secondly, you have to make sure ANT is properly installed. you can check this by
 +
typing:
 +
 +
ant
 +
 +
on the cli. Something like this should appear:
 +
 +
$ ant
 +
Buildfile: build.xml does not exist!
 +
Build failed
 +
 +
if not, check your ant installation (ant is a java program which is used to construct (compile) other java programs) - see http://ant.apache.org/
 +
 +
the 'build.xml' is the file which says to ant what to do. check out freeplane code for the directory containing the build.xml (its in freeplane/ant/ !)
 +
 +
just go there with your cli - using the 'cd' program (hope you know how to do that) and execute ant again. now the output changes:
 +
 +
$ ant
 +
Buildfile: build.xml
 +
 +
clean:
 +
  [delete] Deleting directory c:\Users\Robert\Documents\workspace-freeplane\freeplane\build
 +
 +
build:
 +
    [echo] Freeplane Version = 1.0.21.
 +
  [mkdir] Created dir: c:\Users\Robert\Documents\workspace-freeplane\freeplane\build
 +
  [javac] Compiling 567 source files to c:\Users\Robert\Documents\workspace-freeplane\freeplane\build
 +
  [javac] Note: Some input files use or override a deprecated API.
 +
  [javac] Note: Recompile with -Xlint:deprecation for details.
 +
  [javac] Note: Some input files use unchecked or unsafe operations.
 +
  [javac] Note: Recompile with -Xlint:unchecked for details.
 +
 +
jar:
 +
  [mkdir] Created dir: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib
 +
    [jar] Building jar: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib\freeplane
 +
viewer.jar
 +
    [jar] Building jar: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib\freeplane
 +
editor.jar
 +
 +
dist:
 +
    [copy] Copying 5 files to c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib
 +
  [mkdir] Created dir: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\resources
 +
    [copy] Copying 21 files to c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\resourc
 +
es
 +
 +
BUILD SUCCESSFUL
 +
Total time: 54 seconds
 +
 +
Ok, the important line here is 'BUILD SUCCESSFUL'. Ant informs you that it created various artefacts (jar files (have you ever tried to open a jar file with a zip program? try it out!!) and obviously everything is fine.
 +
 +
So how to start your own homegrown freeplane??
 +
 +
 +
... go to the newly created dist directory (assuming you are still in the ant dir)
 +
 +
cd ../bin/dist/lib
 +
 +
java -jar freeplaneeditor.jar
 +
 +
java.lang.NullPointerException
 +
      at org.freeplane.main.application.ApplicationResourceController.readDefaultPreferences(Applicati
 +
onResourceController.java:215)
 +
      at org.freeplane.main.application.ApplicationResourceController.readDefaultPreferences(Applicati
 +
onResourceController.java:230)
 +
      at org.freeplane.main.application.ApplicationResourceController.readDefaultPreferences(Applicati
 +
onResourceController.java:207)
 +
      at org.freeplane.main.application.ApplicationResourceController.<init>(ApplicationResourceContro
 +
ller.java:77)
 +
      at org.freeplane.main.application.FreeplaneStarter.createController(FreeplaneStarter.java:101)
 +
      at org.freeplane.main.application.FreeplaneStarter.run(FreeplaneStarter.java:254)
 +
      at org.freeplane.main.application.FreeplaneStarter.main(FreeplaneStarter.java:69)
 +
Panic! Error while loading default properties.
 +
 +
STDOUT: Controller erzeugen...
 +
STDOUT: User patterns file C:\Users\Robert\.freeplane\patterns.xml not found.28.07.2009 11:46:27 org.fre
 +
eplane.core.util.LogTool warn
 +
WARNUNG: ResourceController.updateMenus(...) called, but not implemented.
 +
28.07.2009 11:46:27 org.freeplane.core.util.LogTool warn
 +
WARNUNG: ResourceController.updateMenus(...) called, but not implemented.
 +
28.07.2009 11:46:27 org.freeplane.core.util.LogTool warn
 +
WARNUNG: ResourceController.updateMenus(...) called, but not implemented.
 +
 +
STDOUT: Maps laden...
 +
 +
this should start your newly built freeplane instance. I've tried it out just now, i have some errors complaining he can't find default property files, this can be fixed by tweaking the classpath a little (classpath is a neat 'thought-to-be' module system for java, soon to be replaced by jigsaw and osgi)
 +
 +
There are other ways to start freeplane in the meantime, since dimitry pulls hard to use osgi, the most efficient way for developing is to use the ide (eclipse - but of course you have to learn eclipse then, too ...)
 +
 +
by following the steps described above you should be able to start freeplane from source, your changes are reflected immediately, but only AFTER you have compiled it again. this means that everytimeyou change something you have to call ANT again from the cli:
 +
 +
ant clean dist
 +
 +
should give you a fresh artifact you can experiment with,
 +
 +
note: of course you can rename the freeplane-editor.jar to freeplane-editor.zip and copy your new icons to the directory 'images' contained in the zip file. this should be the fastest way. the same applies for new translations which can be found in the 'translations' directory.

Revision as of 17:28, 8 August 2009

How to check out Freeplane and use svn

ok, first step is to get a svn client; this is the program you need for checking out of a central repository - the one where we all work together.

you need to understand what 'commit' and 'update' means, there are many hello world tutorials for svn in the net

(by the way, 'svn' stands for 'subversion', this is also the name of a command line program if you have installed the svn client.)

READ: http://subversion.tigris.org/faq.html

especially try to understand what is going on in

http://subversion.tigris.org/faq.html#co-svn

after reading the example, you can try that out in your svn client (either plain cli program svn, tortoisesvn which is a gui for the same functionality integrated in the file explorer) and check out the code from freeplane.

There is also a web interface for better svn browsing:

http://freeplane.svn.sourceforge.net/viewvc/freeplane/

(insert the url directly in your browser, see what happens!)

the files you'll get are locally saved copies from the central repository. you can change them as you like, edit files, delete files, even directories - svn will track what you've done and eventually you can 'commit' the files again, which means you want to put your local changes to the central repository.

You don't need to check out whole projects, subversion can also just checkout a directory, or a subset of directory trees.

Try

svn co https://freeplane.svn.sourceforge.net/svnroot/freeplane/freeplane_program/trunk/freeplane/resources/images

for example: it will create the directory of images you want dimitry to put them 'in the main thing which saves our "code"'. This is it, plain and simple.

Only if you want to change something centrally, you'll have to get a username and a password for that.

Of course, if you use eclipse with the subversion plugin, checking out projects is very easy. you can also try www.netbeans.org, which does it perfectly well also.

concerning your problems: seems like you've tried to add metadata stored in .svn directories which typicaly happens if you download 'somehow' the whole archive (means: without a client). the data in the .svn directories manage the whole 'versioning' process, but this data mustn't be commited, added or updated, its the task of your svn client to do so.

again, there are many svn howtows out there, read

http://paulstamatiou.com/how-to-subversion-basics

where sb uses a command client svn. google for svn howto, subversion basics etc.

BUT: using svn is tricky sometimes ...

How to compile freeplane

here is a short cookbook how to compile freeplane:

(assuming you have checked out the newest code via SVN ;) )

open a cli (on windows this can be done via <windows key> + r ( a window pops up) and you enter 'cmd')

then you have a command line interface. (there are various again, if you want a decent cli use cygwin.com albeit this is not necessary atm)

enter:

java -version

something like this should be displayed:

$ java -version java version "1.6.0_10-beta" Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25) Java HotSpot(TM) Client VM (build 11.0-b12, mixed mode, sharing)

if this doesn't appear, check your JAVA installation (please follow the steps in the readme files thorougly) - go to java.sun.com and get the latest distribution.


then, secondly, you have to make sure ANT is properly installed. you can check this by typing:

ant

on the cli. Something like this should appear:

$ ant Buildfile: build.xml does not exist! Build failed

if not, check your ant installation (ant is a java program which is used to construct (compile) other java programs) - see http://ant.apache.org/

the 'build.xml' is the file which says to ant what to do. check out freeplane code for the directory containing the build.xml (its in freeplane/ant/ !)

just go there with your cli - using the 'cd' program (hope you know how to do that) and execute ant again. now the output changes:

$ ant Buildfile: build.xml

clean:

 [delete] Deleting directory c:\Users\Robert\Documents\workspace-freeplane\freeplane\build

build:

   [echo] Freeplane Version = 1.0.21.
  [mkdir] Created dir: c:\Users\Robert\Documents\workspace-freeplane\freeplane\build
  [javac] Compiling 567 source files to c:\Users\Robert\Documents\workspace-freeplane\freeplane\build
  [javac] Note: Some input files use or override a deprecated API.
  [javac] Note: Recompile with -Xlint:deprecation for details.
  [javac] Note: Some input files use unchecked or unsafe operations.
  [javac] Note: Recompile with -Xlint:unchecked for details.

jar:

  [mkdir] Created dir: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib
    [jar] Building jar: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib\freeplane

viewer.jar

    [jar] Building jar: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib\freeplane

editor.jar

dist:

   [copy] Copying 5 files to c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\lib
  [mkdir] Created dir: c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\resources
   [copy] Copying 21 files to c:\Users\Robert\Documents\workspace-freeplane\freeplane\bin\dist\resourc

es

BUILD SUCCESSFUL Total time: 54 seconds

Ok, the important line here is 'BUILD SUCCESSFUL'. Ant informs you that it created various artefacts (jar files (have you ever tried to open a jar file with a zip program? try it out!!) and obviously everything is fine.

So how to start your own homegrown freeplane??


... go to the newly created dist directory (assuming you are still in the ant dir)

cd ../bin/dist/lib

java -jar freeplaneeditor.jar

java.lang.NullPointerException

      at org.freeplane.main.application.ApplicationResourceController.readDefaultPreferences(Applicati

onResourceController.java:215)

      at org.freeplane.main.application.ApplicationResourceController.readDefaultPreferences(Applicati

onResourceController.java:230)

      at org.freeplane.main.application.ApplicationResourceController.readDefaultPreferences(Applicati

onResourceController.java:207)

      at org.freeplane.main.application.ApplicationResourceController.<init>(ApplicationResourceContro

ller.java:77)

      at org.freeplane.main.application.FreeplaneStarter.createController(FreeplaneStarter.java:101)
      at org.freeplane.main.application.FreeplaneStarter.run(FreeplaneStarter.java:254)
      at org.freeplane.main.application.FreeplaneStarter.main(FreeplaneStarter.java:69)

Panic! Error while loading default properties.

STDOUT: Controller erzeugen... STDOUT: User patterns file C:\Users\Robert\.freeplane\patterns.xml not found.28.07.2009 11:46:27 org.fre eplane.core.util.LogTool warn WARNUNG: ResourceController.updateMenus(...) called, but not implemented. 28.07.2009 11:46:27 org.freeplane.core.util.LogTool warn WARNUNG: ResourceController.updateMenus(...) called, but not implemented. 28.07.2009 11:46:27 org.freeplane.core.util.LogTool warn WARNUNG: ResourceController.updateMenus(...) called, but not implemented.

STDOUT: Maps laden...

this should start your newly built freeplane instance. I've tried it out just now, i have some errors complaining he can't find default property files, this can be fixed by tweaking the classpath a little (classpath is a neat 'thought-to-be' module system for java, soon to be replaced by jigsaw and osgi)

There are other ways to start freeplane in the meantime, since dimitry pulls hard to use osgi, the most efficient way for developing is to use the ide (eclipse - but of course you have to learn eclipse then, too ...)

by following the steps described above you should be able to start freeplane from source, your changes are reflected immediately, but only AFTER you have compiled it again. this means that everytimeyou change something you have to call ANT again from the cli:

ant clean dist

should give you a fresh artifact you can experiment with,

note: of course you can rename the freeplane-editor.jar to freeplane-editor.zip and copy your new icons to the directory 'images' contained in the zip file. this should be the fastest way. the same applies for new translations which can be found in the 'translations' directory.