Page 1 of 1

Building Insight on Linux

PostPosted: Mon Jul 25, 2011 3:48 pm
by a.herbert
Hi,

I've downloaded the latest codebase and am trying to build the insight client.

I downloaded from the GIT repository and have run the ./build.py script in the top level directory. This runs to the end and builds lots of files into the dist directory. However it does not build Insight. A scan of all the jar files in the dist directory cannot find the class org.openmicroscopy.shoola.Main. (Note: I use the nice http://java.net/projects/jarscan/ utility for this.)

I move to the components/insight/build directory and try:

Code: Select all
ant -lib tools


I then get a horrible stack trace error from ant about a missing method from org.apache.tools.ant.util.FileUtils:

Buildfile: build.xml

BUILD FAILED
java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.getFileUtils()Lorg/apache/tools/ant/util/FileUtils;
at org.apache.tools.ant.taskdefs.optional.dotnet.ImportTypelib.<clinit>(ImportTypelib.java:48)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at org.apache.tools.ant.AntTypeDefinition.getTypeClass(AntTypeDefinition.java:161)
at org.apache.tools.ant.AntTypeDefinition.getExposedClass(AntTypeDefinition.java:135)
at org.apache.tools.ant.ComponentHelper.getElementName(ComponentHelper.java:577)
at org.apache.tools.ant.Project.getElementName(Project.java:1769)
at org.apache.tools.ant.IntrospectionHelper.getElementName(IntrospectionHelper.java:1087)
at org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:513)
at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:368)
at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:322)
at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:191)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:158)
at org.apache.tools.ant.Task.perform(Task.java:363)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:125)
at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:142)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
at org.apache.tools.ant.Main.runBuild(Main.java:658)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


I have had a look inside the tools/ant-1.6.2.jar file and the class org.apache.tools.ant.util.FileUtils does exist but does not have the method getFileUtils().

I note that just below this line in the stack trace is a reference to a org.apache.tools.ant.taskdefs.optional.dotnet.ImportTypelib class. This loads .tlb files to a dotnet assembly:
http://www.docjar.com/docs/api/org/apache/tools/ant/taskdefs/optional/dotnet/ImportTypelib.html

Given that I am on Linux I think this is the source of the error. Any ideas why the build is trying to load this?

If anyone has got this to work on Linux then advice would be useful.

Incidentally if I import the projects into Eclipse then I can build and run it from Eclipse ignoring the ant files. I would just like to generate the standalone omero.insight.jar through the correct build process using ant.

Thanks,

Alex

Re: Building Insight on Linux

PostPosted: Mon Jul 25, 2011 5:49 pm
by jmoore
Hi Alex,

left over from our migration to git earlier this year, Insight is still not integrated into the main build (build.py). See #3940 for more info.

Instead, you will need to follow the instructions under the OmeroInsightContributing wiki page. This means roughly:

Code: Select all
cd components/insight/build
java build compile run


Alternatively, you can load the insight project into eclipse.

Cheers,
~Josh.

Re: Building Insight on Linux

PostPosted: Tue Jul 26, 2011 9:54 am
by a.herbert
Hi Josh,

I think you meant to use 'java' in your code sample and not 'ant'. I got the distribution package using:

Code: Select all
cd components/insight/build
java build dist


Thanks for the help.

Alex

Re: Building Insight on Linux

PostPosted: Tue Jul 26, 2011 10:10 am
by jmoore
Thanks for the correction, Alex! I've modified my post so that no one will copy and paste it by mistake.

Cheers,
~Josh.