In the "The glossaries package v4.46: a guide for beginner" on page 24 (from https://www.ctan.org/pkg/glossaries) it is stated:

Having the file myDoc.tex

\GlsXtrLoadResources % input file created by bib2gls
[% instructions to bib2gls:
src={entries}, % terms defined in entries.bib
sort={en-GB}% sort according to this locale
description={an example}}
A \gls{sample}.
\printunsrtglossaries % iterate over all defined entries

and entries.bib:

name = {sample},
description = {an example}

and running

pdflatex myDoc
bib2gls myDoc
pdflatex myDoc

would result in a correct pdf file, but during the step:

bib2gls myDoc

I get:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/dickimawbooks/bib2gls/Bib2Gls : Unsupported major.minor versi
on 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

So either I must do wrong or the instructions are incorrect, but what ?

  • Your entries.bib looks bad. The field description needs an actual description as in description = {an example}. The @entry starts with { but after the corrected description field needs } to close the entry. After doing such corrections it worked fine in my computer May 17 at 12:28
  • @LuisTurcio thanks for pointing that out, unfortunately it was just a copy / paste error to the question, in my original file the contents is (in my opinion) correct. Please see the updated question.
    – albert
    May 17 at 13:21
  • This seems like a Java version error, you need Java 1.8 or higher. See stackoverflow.com/questions/22489398/….
    – Marijn
    May 17 at 14:46
  • @marijn Thanks might be the right call, I have 1.7.0_67 so it looks like I have to upgrade to a newer version, I have to see what I can do...
    – albert
    May 17 at 15:44
  • I installed the 1.8 version and it looks like this is solving the problem. @marijn maybe worth an answer.
    – albert
    May 17 at 16:20

The bib2gls manual mentions the following on the first page:

Note that bib2gls is a Java application, and requires at least Java 81.


1 The List.sort method used to sort the entries was only introduced to Java 8.

The error message Unsupported major.minor version 52.0 is a check that the Java interpreter performs to see if the version set as a target during compilation (here 52.0) is compatible with the currently installed version of Java. 52 is Java 8 (also known as Java 1.8).

So the solution to this problem is to update the Java runtimes. See for more information https://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.