Megan commandline version

Hello,
Could someone help me with adding the License key while using Megan6 UE commandline version. It is instructed to use it with -rc command. But I don’t understand at which step should we add the license key or along with which command ?

Lauch the command line version like this:

megan -g -rc 817b787284586c5…

Here, -g starts the command line version and -rc 817b787284586c5… sets the alpha-numerical MEGAN UE key.

If you are running the program on a Linux computer on which you have a home directory, then
you will only have to specify the key once and it will be stored in a file called ~/.Megan.def.

Instead of passing the key on the command line the first time you run the program, you can
alternatively create and/or edit the file ~/.Megan.def and add this line to the file:

Code= 817b787284586c5…

Hi,
This no longer works for me. megan -g -rc doesn’t generate the ~/.Megan.def file. And if I create the ~/.Megan.def file myself it generates an empty file where I add Code= and my license number.
However, when i try to run e.g the compute-comparison i still get “Exception in thread “main” java.lang.ExceptionInInitializerError: Invalid license key”

I can’t reproduce this problem. I just downloaded the latest version of MEGAN UE onto a Linux Desktop. Then I ran the program like this
MEGAN -g -rc 817b787284586c5...6658596c6165

The program launched fine and after I quitted it had generated a new properties file: /home/huson/.MEGAN.def
containing this line Code=817b787284586c5...6658596c6165.

So, the -rc options should work…

However, my previous instructions were incorrect, if you want to pre-create the properties file, then it should be called .MEGAN.def, not Megan.def.

One issue: if you are running the program on a console-less server, then you need to run it using xvfb, e.g. like this:
xvfb-run --auto-servernum --server-num=1 MEGAN -g -rc 817b787284586c5...6658596c6165

Hi Daniel,

I am running on a console-less server and tried your last solution, which seems to have worked. This also registered my name with MEGAN that I used when purchasing the license key. So it seems that it worked. This generated the .MEGAN.def file successfully including my code.

However, when I run tools such as compute-comparison, read-extractor, and taxonomy2function I still get the following error:

License
Exception in thread “main” java.lang.ExceptionInInitializerError: Invalid license key
at megan6u/megan6u.main.Megan6Ultimate.F(Unknown Source)
at jloda/jloda.util.ProgramProperties.checkState(ProgramProperties.java:433)
at megan6u/megan6u.main.Megan6Ultimate.E(Unknown Source)
at megan6u/megan6u.A.C.A(Unknown Source)
at megan6u/megan6u.tools.CompareFiles.main(Unknown Source)

I can’t seem to reproduce this problem. I did a clean installation of MEGAN on a linux computer and then ran MEGAN as above to create the MEGAN.def file. Then I launched the compute-comparison program as follows:
megan6ue/tools/compute-comparison -i a.daa b.daa -o out.megan

This ran to completion. I’m using version 6.25.9.

You could try explicitly suppling the properties file using the -P file option, but if it is called .MEGAN.def and is in your home directory, then MEGAN should find it.

I can’t get this to work. One solution for me was to download all .daa files from the unix server onto my Windows Desktop. Start the Windows version MEGAN UE, and then run the Compare option from the File option. But I prefer to run compute-comparison on the server as I don’t have to download the .daa files which are huge (each file is several GB).

More concerning is that I can’t run daa-meganizer,read-extractor or taxonomy2function, right now I need to run taxonomy2function for a specific project but I can’t get it to work due to the invalid license message.

I am using the unix version MEGAN 6.25.7, as I am unable to download the .sh files of the newest MEGAN from the download page ( [MEGAN6-download (uni-tuebingen.de)](MEGAN6-download, the .exe and .dmg files work to download).

Hi again,

I got it to work now, and there are two things I did different:

  1. I download MEGAN 6.25.9 from the alternative download page and installed that.
  2. When setting the path for “/usr/local/bin” I put in the correct path to the bin folder on the server “/home/username”

I am not sure if setting the bin path had anything to do with this, but now it works :slightly_smiling_face:

I don’t think that it was the path, I vaguely remember that there was an older version of MEGAN that had the problem that you described…