Author Topic: How to run Ancestris from NetBeans?  (Read 1729 times)

0 Members and 1 Guest are viewing this topic.

Offline AndreasG

  • VIP
  • Jr. Member
  • *
  • Posts: 6
    • View Profile
How to run Ancestris from NetBeans?
« on: April 03, 2024, 22:39:56 »
Hello,

please be aware that I am neither familiar with using NetBeans nor ant!

Trying to run Ancestris from NetBeans using button "Run Project (Ancestris-12) (F6)" results in error message:
Code: [Select]
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\build.xml:7: The following error occurred while executing this line:
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\nbproject\build-impl.xml:41: Cannot find NetBeans build harness.
Check that nbplatform.custom.netbeans.dest.dir and nbplatform.custom.harness.dir are defined.
On a developer machine these are normally defined in C:\Users\Andreas\AppData\Roaming\NetBeans\19\build.properties=C:\Users\Andreas\AppData\Roaming\NetBeans\19/build.properties
but for automated builds you should pass these properties to Ant explicitly.

Further details please see below.

Building/running "ancestris.app" results in:
Code: [Select]
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\ancestris.app\build.xml:7: The following error occurred while executing this line:
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\ancestris.app\nbproject\build-impl.xml:44: Cannot find C:\Users\Andreas\Documents\netbeans_platform_12.5\harness\build.xml imported from C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\ancestris.app\nbproject\build-impl.xml
Building/running "core" throws same messages with "core" instead of "ancestris.app".
Folder C:\Users\Andreas\Documents\netbeans_platform_12.5 does not exist.

Hoping somebody can tell me what I am doing wrong and/or what I have to do.

Thanks and regards
Andreas


Installation details from NetBeans <Help><About>
Code: [Select]
Product Version: Apache NetBeans IDE 19
Java: 20.0.1; OpenJDK 64-Bit Server VM 20.0.1+9-29
Runtime: OpenJDK Runtime Environment 20.0.1+9-29
System: Windows 10 version 10.0 running on amd64; UTF-8; de_DE (nb)
User directory: C:\Users\Andreas\AppData\Roaming\NetBeans\19
Cache directory: C:\Users\Andreas\AppData\Local\NetBeans\Cache\19

Installation dates (because of the versions)
Code: [Select]
Java: July 2023
NetBeans: November 2023
Ancestris: November 2023 - via svn according to https://docs.ancestris.org/books/contribution/page/coding with user 'anonymous' and password 'password'

Further details
Code: [Select]
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\build.xml:7:
<import file="nbproject/build-impl.xml"/>

C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\nbproject\build-impl.xml:41:
<ant antfile="nbproject/platform.xml"/>

C:\Users\Andreas\AppData\Roaming\NetBeans\19\build.properties:
nbplatform.default.harness.dir=${nbplatform.default.netbeans.dest.dir}/harness
nbplatform.default.netbeans.dest.dir=C:\\ProgAdd\\NetBeans-19\\netbeans

In <View><IDE log> I found:
WARNING [org.netbeans.modules.apisupport.project]: Project in C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\core is missing its platform 'custom', switching to default platform

Offline Zurga

  • VIP
  • Supernatural Member
  • *
  • Posts: 3 981
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #1 on: April 03, 2024, 23:46:53 »
Like the message said : use Netbeans 12.5, not 19.
You can download it from : https://netbeans.apache.org/front/main/download/nb125/nb125/
The other way is to download the Ancestris zip package from site and use platform and harness directory as platform for Netbeans in order to launch Ancestris from Netbeans.

Please indicates if this help.

Could you indicate what you intend to do with the code ?

Zurga

Offline AndreasG

  • VIP
  • Jr. Member
  • *
  • Posts: 6
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #2 on: April 04, 2024, 19:02:46 »
Thank you for your quick reply.

Nearly 15 years ago I started to develop a stand-alone program to show genealogy data based on gedcom format. Now I want to try to integrate this in Ancestris as a report. I will first do it only for myself to prove whether I can get this working. So I currently do not need to make changes to the original code.


According to your proposal I have deleted the project directory and deinstalled NetBeans 19 and installed NetBeans 12.5 instead. And I had to install Java 11 (version 11.0.22+7) because NetBeans 12.5 does not run with a higher Java version (Java download from "https://www.openlogic.com/openjdk-downloads?field_java_parent_version_target_id=406&field_operating_system_target_id=All&field_architecture_target_id=All&field_java_package_target_id=All").

Code: [Select]
Product Version: Apache NetBeans IDE 12.5
Java: 11.0.22; OpenJDK 64-Bit Server VM 11.0.22+7-adhoc..jdk11u
Runtime: OpenJDK Runtime Environment 11.0.22+7-adhoc..jdk11u
System: Windows 10 version 10.0 running on amd64; Cp1252; de_DE (nb)
User directory: C:\Users\Andreas\AppData\Roaming\NetBeans\12.5
Cache directory: C:\Users\Andreas\AppData\Local\NetBeans\Cache\12.5


But the problems are the same ones:
Code: [Select]
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\build.xml:7: The following error occurred while executing this line:
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\nbproject\build-impl.xml:41: Cannot find NetBeans build harness.
Check that nbplatform.custom.netbeans.dest.dir and nbplatform.custom.harness.dir are defined.
On a developer machine these are normally defined in C:\Users\Andreas\AppData\Roaming\NetBeans\12.5\build.properties=C:\Users\Andreas\AppData\Roaming\NetBeans\12.5/build.properties
but for automated builds you should pass these properties to Ant explicitly.
Code: [Select]
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\ancestris.app\build.xml:7: The following error occurred while executing this line:
C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\ancestris.app\nbproject\build-impl.xml:44: Cannot find C:\Users\Andreas\Documents\netbeans_platform_12.5\harness\build.xml imported from C:\Users\Andreas\Documents\NetBeansProjects\AncestrisCore\ancestris.app\nbproject\build-impl.xml


Ancestris.zip (downloaded July 2023) has directories platform and harness. But I do not know where to place them in the project directory.

Andreas

Offline Zurga

  • VIP
  • Supernatural Member
  • *
  • Posts: 3 981
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #3 on: April 04, 2024, 19:47:12 »
Place it outside of the project.
Then go to "Tools" menu => "Netbeans platform".
Add a new one named "custom" and point the directory where you put the platform directory.

Then you can check that the project will use the correct platform : right-click on project "Ancestris 12", open "Properties", then "Libraries" then check the "Netbeans Platform" value.

This should allow you to launch the application from Netbeans.

Zurga

Offline AndreasG

  • VIP
  • Jr. Member
  • *
  • Posts: 6
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #4 on: April 04, 2024, 21:56:24 »
Everything is as you described it.

I copied directories platform and harness to a newly created directory and changed <Tools><NetBeans Platforms>.
Ancestris-12 <Properties><Libraries><Netbeans Platform> shows the expected.

But however I am using the name "custom" or the original label
"Apache NetBeans Platform Dev (Build 12.5-fd523ddc12d6156412d7b81f0c8663d8913d1021)"

=> the error message remain unchanged in both cases.

Must be done any changes in one or more of the config files?

Andreas

Offline Zurga

  • VIP
  • Supernatural Member
  • *
  • Posts: 3 981
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #5 on: April 04, 2024, 23:03:56 »
I have tried with a fresh new install of Netbeans 21.
I have opened the project and all the module.
I have defined the custom platform, check the platform version used.
Then I launch "clean and build" and everything rune smoothly.
No error.
And I could launch the application.
So I have no explanation on what happens to your installation.

Zurga

Offline AndreasG

  • VIP
  • Jr. Member
  • *
  • Posts: 6
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #6 on: April 04, 2024, 23:06:58 »
Please tell me which java version you are using.

Andreas

Offline Zurga

  • VIP
  • Supernatural Member
  • *
  • Posts: 3 981
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #7 on: April 04, 2024, 23:07:34 »
Java 11 or Java 17.

Zurga

Offline AndreasG

  • VIP
  • Jr. Member
  • *
  • Posts: 6
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #8 on: April 06, 2024, 22:41:49 »
It seems not to depend on the version neiither of Java nor of NetBeans.
And it seems the name of the platform folder (with subdirectories harness and platform) must be exactly "netbeans_platform_12.5" (in this case) and, as you already wrote, the platform name must be "custom".

So I am one step forward and get now a different build error:
Code: [Select]
C:\Users\Andreas\Documents\NetBeansAncestris\AncestrisCore\build.xml:7: The following error occurred while executing this line:
C:\Users\Andreas\Documents\NetBeansAncestris\AncestrisCore\nbproject\build-impl.xml:48: Cannot find C:\Users\Andreas\Documents\netbeans_platform_12.5\harness\suite.xml imported from C:\Users\Andreas\Documents\NetBeansAncestris\AncestrisCore\nbproject\build-impl.xml

Please check whether your harness directory contains a file "suite.xml".

The only one I can find is in the NetBeans installation directory and copying this one does not solve the problem but creates another error message.
Code: [Select]
C:\Users\Andreas\Documents\NetBeansAncestris\AncestrisCore\build.xml:7: The following error occurred while executing this line:
C:\Users\Andreas\Documents\NetBeansAncestris\AncestrisCore\nbproject\build-impl.xml:48: The following error occurred while executing this line:
C:\Users\Andreas\Documents\netbeans_platform_12.5\harness\suite.xml:24: Cannot find C:\Users\Andreas\Documents\netbeans_platform_12.5\harness\jdk.xml imported from C:\Users\Andreas\Documents\netbeans_platform_12.5\harness\suite.xml

Andreas

Offline Zurga

  • VIP
  • Supernatural Member
  • *
  • Posts: 3 981
    • View Profile

Offline AndreasG

  • VIP
  • Jr. Member
  • *
  • Posts: 6
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #10 on: April 17, 2024, 21:11:29 »
Hello Zurga,

sorry for my late reply.

With your installation everything works fine.

It seems these are the only files missing (in the harness directory):
Code: [Select]
build.xml
common.xml
jdk.xml
jnlp.xml
no-testcoverage.xml
run.xml
suite.xml
tasks.jar

What's about putting these files into the harness directory of the zip file?

Thanks for your help
Andreas

Offline Zurga

  • VIP
  • Supernatural Member
  • *
  • Posts: 3 981
    • View Profile
Re: How to run Ancestris from NetBeans?
« Reply #11 on: April 17, 2024, 22:35:01 »
The zip is done automatically by the compilation and packaging by the automatic tools of Netbeans.
Perhaps we can think about this.

Zurga