Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not create the Java Virtual Machine. #103

Open
victoriafrickel opened this issue May 2, 2023 · 4 comments
Open

Error: Could not create the Java Virtual Machine. #103

victoriafrickel opened this issue May 2, 2023 · 4 comments
Assignees

Comments

@victoriafrickel
Copy link

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!.

@mkraetke
Copy link
Member

mkraetke commented May 2, 2023

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

@higherstateofawkwardness

@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

@Stoneboyp
Copy link

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.

@DDong1997
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants