gcam-core icon indicating copy to clipboard operation
gcam-core copied to clipboard

error run run-gcam.bat

Open LyyDandelion opened this issue 5 years ago • 16 comments

errors: ---------------start----------------------- Configuration file: configuration.xml Parsing input files... Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries ---------------end----------------------- jdk version: 1.8

LyyDandelion avatar Feb 26 '20 02:02 LyyDandelion

Same problem. have you fixed this error?thx.

debibooo avatar Dec 31 '20 03:12 debibooo

To debug this we would need more information. Are you able to run the Model Interface .jar and is it using the same version of Java as GCAM is attempting to use?

Note you can manually change which Java is being used by GCAM by editing run-gcam.bat and changing:

REM SET JAVA_HOME=C:\Program Files\Java\jre1.8.0_101

To:

SET JAVA_HOME=<path to the correct version of Java>

In addition you should ensure you do not have any copies of jvm.dll into your exe directory. Some users have had this happen and causes a failure such as this.

pralitp avatar Jul 13 '21 20:07 pralitp

Hi @pralitp, I am facing a similar issue. The error is something like this.

Configuration file:configuration.xml Parsing input files... Error occurred during initialization of VM Failed setting boot class path.

I did follow the steps you mentioned but still nothing.

Amalsarfraz avatar Aug 24 '21 16:08 Amalsarfraz

Could you post which version of Java you are using?

I haven't seen the "Failed setting boot class path." (which is different than "Unable to load native library: Can't find dependent libraries ") however some googling seems to indicate it might be related to special characters in the path to your GCAM workspace. You could test this theory out by moving the entire GCAM workspace to someplace simple such as C:\GCAM and see if still have the issue then.

pralitp avatar Aug 24 '21 17:08 pralitp

JDK 16.0.2.

And still no luck with the simple GCAM workspace. Still getting the same error.

Amalsarfraz avatar Aug 24 '21 17:08 Amalsarfraz

Could you try running Java directly from the Windows CMD prompt from within the "exe" directory of your GCAM workspace as follows to replicate the way GCAM will try to run it and see if it works:

java -cp XMLDBDriver.jar;../libs/jars/*;../output/modelinterface/ModelInterface.jar -Djava.system.class.loader=WildcardExpandingClassLoader XMLDBDriver --help

And maybe also just:

java -cp XMLDBDriver.jar;../libs/jars/*;../output/modelinterface/ModelInterface.jar XMLDBDriver --help

pralitp avatar Aug 24 '21 19:08 pralitp

Getting the following errors nows.

For the first one. Java HotSpot(TM) 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "WildcardExpandingClassLoader"). To use archived non-system classes, this property must not be set Error occurred during initialization of VM java.lang.Error: WildcardExpandingClassLoader at java.lang.ClassLoader.initSystemClassLoader([email protected]/ClassLoader.java:1990) at java.lang.System.initPhase3([email protected]/System.java:2132) Caused by: java.lang.ClassNotFoundException: WildcardExpandingClassLoader at jdk.internal.loader.BuiltinClassLoader.loadClass([email protected]/BuiltinClassLoader.java:636) at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass([email protected]/ClassLoaders.java:182) at java.lang.ClassLoader.loadClass([email protected]/ClassLoader.java:519) at java.lang.Class.forName0([email protected]/Native Method) at java.lang.Class.forName([email protected]/Class.java:466) at java.lang.ClassLoader.initSystemClassLoader([email protected]/ClassLoader.java:1976) at java.lang.System.initPhase3([email protected]/System.java:2132)

second one Error: Could not find or load main class XMLDBDriver Caused by: java.lang.ClassNotFoundException: XMLDBDriver

Amalsarfraz avatar Aug 25 '21 08:08 Amalsarfraz

Hi there! Have you solved the problems?

Cermouth avatar Feb 13 '22 07:02 Cermouth

Hi, after doing everything pralitp said, I also set a system variable named JAVA_HOME.

Amalsarfraz avatar Feb 13 '22 11:02 Amalsarfraz

Following @pralitp 's words, getting the following errors nows.

For the first one:

Java HotSpot(TM) 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "WildcardExpandingClassLoader"). To use archived non-system classes, this property must not be set USAGE: java -cp XMLDBDriver.jar XMLDBDriver --db-path=PATH --doc-name=NAME --xml=FILE or java -cp XMLDBDriver.jar XMLDBDriver --print-java-path

NOTE: If the first form is used, the arguments -db-path, --doc-name, and --xml are all required. Options can be abbreviated using any unique prefix, e.g., --db=XXX --doc=YYY -x foo.xml

Option Description


--db-path Path to XML database --doc-name The unique name to call the document in the DB --help Print this message --print-java-home Print the path to the Java home directory and exit --xml The exported GCAM results XML file to load

For the second one:

USAGE: java -cp XMLDBDriver.jar XMLDBDriver --db-path=PATH --doc-name=NAME --xml=FILE or java -cp XMLDBDriver.jar XMLDBDriver --print-java-path

NOTE: If the first form is used, the arguments -db-path, --doc-name, and --xml are all required. Options can be abbreviated using any unique prefix, e.g., --db=XXX --doc=YYY -x foo.xml

Option Description


--db-path Path to XML database --doc-name The unique name to call the document in the DB --help Print this message --print-java-home Print the path to the Java home directory and exit --xml The exported GCAM results XML file to load

Different from @Amalsarfraz 's errors. Could anyone help? Thanks :)

Cermouth avatar Feb 14 '22 09:02 Cermouth

Hi @pralitp , my problems are similar to @LyyDandelion 's. Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries

I have set the JAVA_HOME and am sure the environmental variables are correct (because the model runs well on another computer).

Java version: JDK-17.0.2

Thanks for your help!

Cermouth avatar Feb 14 '22 19:02 Cermouth

I deleted the "jvm.dll" in C:\Windows\System32 and the model worked. Thanks anyway for this issue!

Cermouth avatar Feb 14 '22 19:02 Cermouth

(MACOS 12 system-M1 chip) I am using oracle JDK 17 x86 version because the arm64 version failed to run. But the ModelInterface requires other versions of JAVA. By following the instruments of the computer, a version of JAVA 8 update 333 was automatically installed in the Library/ Internet Plug-ins/.... After the installation, ModelInterface can be successfully opened. Yet the 'java -version' in terminal still shows as "17.0.3.1".
Then,I have the same problem as @Amalsarfraz , the error occurred as "Failed setting boot class path" when running the run-gcam.command , and after conducted @pralitp 's suggestion, the error still showed exactly like Amalsarfraz's. The environmental variable JAVA_HOME was already set as "JAVA_HOME=$(/usr/libexec/java_home)" . There is no non-english character in the work path. What can I do to solve this problem?

Fan-Ru avatar May 10 '22 05:05 Fan-Ru

the .bash_profile was set as: JAVA_HOME=$(/usr/libexec/java_home) PATH=".$PATH:$JAVA_HOME/bin" CLASS_PATH=<GCAM workspace>/exe/XMLDBDriver.jar:<GCAM workspace>/libs/jars/*:<GCAM workspace>/output/modelinterface/ModelInterface.jar

Fan-Ru avatar May 10 '22 11:05 Fan-Ru

Has this been solved? I am similarly getting an error like this:

Parsing input files...
OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "WildcardExpandingClassLoader"). To use archived non-system classes, this property must be not be set
ERROR: XML Read Exception message is:
unable to open primary document entity '/home/ewood/GCAM/gcam-core/input/gcamdata/xml/modeltime.xml'

when I attempt to run gcam.exe on my Ubuntu 20.04 system.

ecwood avatar May 23 '22 07:05 ecwood

请问解决了吗,我也遇到了这个问题

2793872087 avatar Dec 23 '23 01:12 2793872087