Problems compiling BaseX in Eclipse Oxygen
Friday, 13 April 2018 · 9 messages
BE
Ben Engbers13 Apr 2018 01:11 #
Hi,
I want to compile and run the basex-examples in Eclipse (Oxygen) but even after adding Maven-support, I can't manage to compile the sources (were downloaded with git).
When I look at the properties for the basex-examples project, I would expect to find the Java-classes in the target/classes directory but this directory does not contain any java classes.
How can I compile the sources?
Thanks,
Ben
AH
Alexander Holupirek13 Apr 2018 10:02 #
Hi Ben,
in principle there's 'nothing special' to watch out for.
- $ git clone git at github.com:BaseXdb/basex.git
- Eclipse: File -> Import -> Git -> Projects from Git
The project should compile properly and one should be able to run the examples. What problems do you encounter?
Cheers,
Alex
Quoted text · Ben Engbers · 16 lines
> On 13. Apr 2018, at 01:11, Ben Engbers <Ben.Engbers at Be-Logical.nl> wrote: > > Hi, > > I want to compile and run the basex-examples in Eclipse (Oxygen) but even after adding Maven-support, I can't manage to compile the sources (were downloaded with git). > > When I look at the properties for the basex-examples project, I would expect to find the Java-classes in the target/classes directory but this directory does not contain any java classes. > > > > How can I compile the sources? > > Thanks, > > Ben >
BE
Ben Engbers13 Apr 2018 11:21 #
Hi,
I select basex-examples [basex master], right-click and 'Run As´ java application. Eclipse starts building a type hiërarchie and returns with this dialog:
After selecting QueryExample, I get this missege in the console: Error: Could not find or load main class org.basex.examples.api.QueryExample
I checked but QueryExample.class does not exist
Ben
Quoted text · Alexander Holupirek · 13 lines
Op 13-04-18 om 10:02 schreef Alexander Holupirek: > Hi Ben, > > in principle there's 'nothing special' to watch out for. > > - $ git clone git at github.com:BaseXdb/basex.git > - Eclipse: File -> Import -> Git -> Projects from Git > > The project should compile properly and one should be able to run the examples. > What problems do you encounter? > > Cheers, > Alex
AH
Alexander Holupirek13 Apr 2018 11:35 #
Hi Ben,
do you have Project -> Build Automatically enabled?
What happens if you try to run 'HTMLExample' (select basex-examples [basex master], right-click and 'Run As´ java application, select 'HTMLExample - org.basex.examples.create'?
Cheers,
Alex
Quoted text · Ben Engbers · 33 lines
> On 13. Apr 2018, at 11:21, Ben Engbers <Ben.Engbers at Be-Logical.nl> wrote: > > Hi, > > I select basex-examples [basex master], right-click and 'Run As´ java application. Eclipse starts building a type hiërarchie and returns with this dialog: > > <mlahhplipfinldho.png> > > After selecting QueryExample, I get this missege in the console: > Error: Could not find or load main class org.basex.examples.api.QueryExample > > I checked but QueryExample.class does not exist > > Ben > > > Op 13-04-18 om 10:02 schreef Alexander Holupirek: >> Hi Ben, >> >> in principle there's 'nothing special' to watch out for. >> >> - $ git clone >> git at github.com:BaseXdb/basex.git >> >> - Eclipse: File -> Import -> Git -> Projects from Git >> >> The project should compile properly and one should be able to run the examples. >> What problems do you encounter? >> >> Cheers, >> Alex >> >
BE
Ben Engbers13 Apr 2018 11:46 #
Hi Alex,
Automatic build is enabled.
Error: Could not find or load main class
org.basex.examples.create.HTMLExample
Quoted text · Alexander Holupirek · 1 line
Op 13-04-18 om 11:35 schreef Alexander Holupirek:
This is how basex shows up in my project-explorer:
I am running Fedora on a Thinkpad
Ben
Quoted text · Alexander Holupirek · 42 lines
> Hi Ben, > > do you have Project -> Build Automatically enabled? > > What happens if you try to run 'HTMLExample' (select basex-examples [basex master], right-click and 'Run As´ java application, select 'HTMLExample - org.basex.examples.create'? > > Cheers, > Alex > >> On 13. Apr 2018, at 11:21, Ben Engbers <Ben.Engbers at Be-Logical.nl> wrote: >> >> Hi, >> >> I select basex-examples [basex master], right-click and 'Run As´ java application. Eclipse starts building a type hiërarchie and returns with this dialog: >> >> <mlahhplipfinldho.png> >> >> After selecting QueryExample, I get this missege in the console: >> Error: Could not find or load main class org.basex.examples.api.QueryExample >> >> I checked but QueryExample.class does not exist >> >> Ben >> >> >> Op 13-04-18 om 10:02 schreef Alexander Holupirek: >>> Hi Ben, >>> >>> in principle there's 'nothing special' to watch out for. >>> >>> - $ git clone >>> git at github.com:BaseXdb/basex.git >>> >>> - Eclipse: File -> Import -> Git -> Projects from Git >>> >>> The project should compile properly and one should be able to run the examples. >>> What problems do you encounter? >>> >>> Cheers, >>> Alex >>> >
AH
Alexander Holupirek13 Apr 2018 11:52 #
Hi Ben,
the red signs indicate problems.
Is there output in the 'Problems'-View (Window->Show View->Problems)? What happens if you Project->Clean...->Clean all projects(enabled)->Clean?
Cheers,
Alex
Quoted text · Ben Engbers · 65 lines
> On 13. Apr 2018, at 11:46, Ben Engbers <Ben.Engbers at Be-Logical.nl> wrote: > > Hi Alex, > > Automatic build is enabled. > > Error: Could not find or load main class org.basex.examples.create.HTMLExample > Op 13-04-18 om 11:35 schreef Alexander Holupirek: > > This is how basex shows up in my project-explorer: > > <jmbneapdbnikpkjo.png> > > I am running Fedora on a Thinkpad > > Ben >> Hi Ben, >> >> do you have Project -> Build Automatically enabled? >> >> What happens if you try to run 'HTMLExample' (select basex-examples [basex master], right-click and 'Run As´ java application, select 'HTMLExample - org.basex.examples.create'? >> >> Cheers, >> Alex >> >> >>> On 13. Apr 2018, at 11:21, Ben Engbers <Ben.Engbers at Be-Logical.nl> >>> wrote: >>> >>> Hi, >>> >>> I select basex-examples [basex master], right-click and 'Run As´ java application. Eclipse starts building a type hiërarchie and returns with this dialog: >>> >>> <mlahhplipfinldho.png> >>> >>> After selecting QueryExample, I get this missege in the console: >>> Error: Could not find or load main class org.basex.examples.api.QueryExample >>> >>> I checked but QueryExample.class does not exist >>> >>> Ben >>> >>> >>> Op 13-04-18 om 10:02 schreef Alexander Holupirek: >>> >>>> Hi Ben, >>>> >>>> in principle there's 'nothing special' to watch out for. >>>> >>>> - $ git clone >>>> >>>> git at github.com:BaseXdb/basex.git >>>> >>>> >>>> - Eclipse: File -> Import -> Git -> Projects from Git >>>> >>>> The project should compile properly and one should be able to run the examples. >>>> What problems do you encounter? >>>> >>>> Cheers, >>>> Alex >>>> >>>> >> >
BE
Ben Engbers13 Apr 2018 11:58 #
Hi Alex,
Cheers,
Ben
Quoted text · Alexander Holupirek · 5 lines
Op 13-04-18 om 11:52 schreef Alexander Holupirek: > Hi Ben, > > the red signs indicate problems. > Is there output in the 'Problems'-View (Window->Show View->Problems)?
A lot of lines like this one:
Description Resource Path Location Type
Archive for required library:
'/home/bengbers/.m2/repository/org/jdom/jdom/1.1/jdom-1.1.jar' in project 'basex-api' cannot be read or is not a valid ZIP file basex-api Build path Build Path Problem
Quoted text · Alexander Holupirek · 1 line
> What happens if you Project->Clean...->Clean all projects(enabled)->Clean?
Cleaning does not help
Quoted text · Alexander Holupirek · 3 lines
> > Cheers, > Alex
AH
Alexander Holupirek13 Apr 2018 12:21 #
Quoted text · Ben Engbers · 9 lines
> On 13. Apr 2018, at 11:58, Ben Engbers <Ben.Engbers at Be-Logical.nl> wrote: >> the red signs indicate problems. >> Is there output in the 'Problems'-View (Window->Show View->Problems)? > A lot of lines like this one: > Description Resource Path Location Type > Archive for required library: > '/home/bengbers/.m2/repository/org/jdom/jdom/1.1/jdom-1.1.jar' in > project 'basex-api' cannot be read or is not a valid ZIP file > basex-api Build path Build Path Problem
You seem to have a maven problem. The .m2 folder is mavens local repository (it is used to store all your project’s dependencies (plugin jars and other files which are downloaded by Maven)). Perhaps during the recent installation you went offline or something like that).
At least, this is not a basex related problem.
However, you can try to get it resolved by
- removing the whole maven folder:
$ rm -rf ~/.m2
- Eclipse: Project -> Clean all projects
(errors and warning afterwards are expected in the package explorer view)
- Eclipse: Package Explorer View - right-click one of the basex-xxx entries -> Maven -> Update Project -> Select All (basex-api, basex-core, basex-examples, basex-tests)
The expectation is that the maven local repository is rebuild (dependencies downloaded again) without problems. Afterward the automatic build will probably kick in and compile all projects.
Hope this helps,
Alex
BE
Ben Engbers13 Apr 2018 12:33 #
Yep!
:-)
Ben
Quoted text · Ben Engbers · 31 lines
Op 13-04-18 om 12:21 schreef Alexander Holupirek: >> On 13. Apr 2018, at 11:58, Ben Engbers <Ben.Engbers at Be-Logical.nl> wrote: >>> the red signs indicate problems. >>> Is there output in the 'Problems'-View (Window->Show View->Problems)? >> A lot of lines like this one: >> Description Resource Path Location Type >> Archive for required library: >> '/home/bengbers/.m2/repository/org/jdom/jdom/1.1/jdom-1.1.jar' in >> project 'basex-api' cannot be read or is not a valid ZIP file >> basex-api Build path Build Path Problem > You seem to have a maven problem. The .m2 folder is mavens local repository (it is used to store all your project’s dependencies (plugin jars and other files which are downloaded by Maven)). Perhaps during the recent installation you went offline or something like that). > > At least, this is not a basex related problem. > > However, you can try to get it resolved by > > - removing the whole maven folder: > $ rm -rf ~/.m2 > - Eclipse: Project -> Clean all projects > (errors and warning afterwards are expected in the package explorer view) > - Eclipse: Package Explorer View - right-click one of the basex-xxx entries -> Maven -> Update Project -> Select All (basex-api, basex-core, basex-examples, basex-tests) > > The expectation is that the maven local repository is rebuild (dependencies downloaded again) without problems. > Afterward the automatic build will probably kick in and compile all projects. > > Hope this helps, > Alex > > > >
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery