docx2tex icon indicating copy to clipboard operation
docx2tex copied to clipboard

Error: Could not create the Java Virtual Machine.

Open victoriafrickel opened this issue 1 year ago • 4 comments

Hello! I am trying to execute the command: d2t.bat myfile.docx on a cmd in windows 10 but its throwing error in the output file myfile.log

Unrecognized option: --add-opens Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

I download 64-bit Java 8 for Windows.

If anyone can help it will awesome!.

victoriafrickel avatar May 02 '23 12:05 victoriafrickel

Hi Victoria,

Which Java version do you have installed? As a workaround, you can edit d2t.bat and remove the lines 51 and 52.

   --add-opens java.base/sun.nio.ch=ALL-UNNAMED ^
   --add-opens java.base/java.io=ALL-UNNAMED ^

Kind regards, Martin

mkraetke avatar May 02 '23 12:05 mkraetke

@mkraetke Adding this here as I've just encountered the same problem on Windows 10; oracle shows my Java as version 8 update 371 (build 1.8.0_371-b11).

I couldn't find the two --add-opens lines in d2t.bat, but did find them as lines 50/51 in calabash.bat.

I removed them so that the section reads: @set CALABASH=java ^ -cp "%classpath%" ^ -Dfile.encoding=UTF8 ^ -Dsun.jnu.encoding=UTF-8 ^ -Dlog4j2.formatMsgNoLookups=true ^ -Dxml.catalog.files=%scriptdir_uri%xmlcatalog/catalog.xml ^ -Djdk.xml.entityExpansionLimit=%entityexpansionlimit% ^ -Xmx%heap% -Xss1024k ^ com.xmlcalabash.drivers.Main ^ -E org.xmlresolver.Resolver ^ -U org.xmlresolver.Resolver ^ -c "%config%"

Now it halts on a new error: Only options can occur on the command line after the pipeline document. Usage: com.xmlcalabash.drivers.Main [switches/options] [pipeline.xpl] [options] or: com.xmlcalabash.drivers.Main [switches/options] { [inputs/parameters] step [options] }+

etc. etc.

Thanks, Jon

Which Java version do you have installed? As a workaround, you can edit d2t.bat and remove the lines 51 and 52. I think you have meant the file calabash.bat in ./calabash/

I have done as you've suggested and now i am encountering another error. %filename%.log contains output of command "java" without any arguments on windows.

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32    use a 32-bit data model if available
    -d64    use a 64-bit data model if available
    -server    to select the "server" VM
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

Stoneboyp avatar Jun 08 '23 09:06 Stoneboyp

I meet the same issue. In addition to install Java 8, I also try to install the JDK in https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe, and the problem is perfectly solved without any errors.

DDong1997 avatar Sep 29 '23 03:09 DDong1997