arx-deidentifier / arx

ARX is a comprehensive open source data anonymization tool aiming to provide scalability and usability. It supports various anonymization techniques, methods for analyzing data quality and re-identification risks and it supports well-known privacy models, such as k-anonymity, l-diversity, t-closeness and differential privacy.
http://arx.deidentifier.org/
Apache License 2.0
620 stars 213 forks source link

[FEATURE] How to Debug ARX using Eclipse? #450

Closed unical1988 closed 1 year ago

unical1988 commented 1 year ago

I would like to debug ARX code using Eclipse. How do I have to proceed to do so?

prasser commented 1 year ago

This should help (also read the comments):

https://github.com/iaBIH/arx/discussions/5

Works?

idhamari commented 1 year ago

I would like to debug ARX code using Eclipse. How do I have to proceed to do so?

This is also a good tutorial about debugging in eclipse.

unical1988 commented 1 year ago

@prasser As suggested by the video here https://drive.google.com/file/d/11lFZk71YCDAIUUPjwAObhrOfC93V6w-D/view, it does not, I can't find the run as an application for the src/main/gui/Main.java file

idhamari commented 1 year ago

it does not, I can't find the run as an application for the src/main/gui/Main.java file

Can you show what does not work? screenshots and/or videos of your steps would be helpful.

unical1988 commented 1 year ago

@idhamari when I right click on the Main.java in the gui folder (org.de-indentifier.arx.gui) as the highlighted video shows, the list doesn't contain the option "run as an application" but just "run configuration". It must be a project setup problem, that I can't figure out anyway.

idhamari commented 1 year ago

@unical1988 can you make sure that your eclipse and java were installed correctly e.g. by trying to create any simple java project then compile it and run it in eclipse?

unical1988 commented 1 year ago

@idhamari sure eclipse works ok.

prasser commented 1 year ago

Then it's likely that your project setup is not correct. Have you followed the steps described at the link exactly? Maybe delete the project and start again following the instructions?

unical1988 commented 1 year ago

Given as mentioned that the run as application option is not offered when I right-click the Main.java in the GUI folder (in order to execute ARX), I set the run configurations "goal" to be equal to exec:java. But then when I run that configuration I get the following error:

Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:3.1.0:java are missing or invalid

Which I tried to solve using: <mainClass>${project.basedir}/src/gui/Main</mainClass> Inside

<plugin>
<groupId>org.codehaus.mojo</groupId>
...
<configuration> 
<!-- I specify the location of the main class here-->
...
</configuration> 
</plugin>

But still get the same error as before doing this.

prasser commented 1 year ago

You should not use Maven. Per default, ARX runs in Eclipse without Maven und the binaries are built using Ant (but you don't need to run Ant to be able to compile / debug ARX in Eclipse). As I said, something seems to be wrong with your project. It is, for example, important to not create a Maven project, but a Java project and to not add the Maven nature. Create a simple Java project following the steps in the tutorial linked above.

unical1988 commented 1 year ago

I deleted and imported the project again as Java application, and it worked, I am able to open the GUI and debug the software. Now, if I have implementation inquiries (e.g., about the role of some method or a class in the code), how/where could I ask them?

idhamari commented 1 year ago

From this: When you have a general question about data anonymization or ARX, please do not create an issue but send us an email.

This probably will be useful to have

prasser commented 1 year ago

Great. Will close this now.