简体   繁体   中英

How to suppress Octave io package load warning: "OpenJDK 64-Bit Server VM warning: Archived … java.system.class.loader property

Is there a way in Octave to suppress the io package load warning message below:

OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "org.octave.OctClassLoader"). To use archived non-system classes, this property must be not be set

I have no control on what the io package load is doing and the rest of my program works OK. But it is very annoying how it clutters the console output.

I am running the octave script in Xubuntu 18.04

Thanks!

I don't know if this is specifically anything to do with the io package per se. It may just be how you have set up octave to use java on your system.

Also, this warning seems to be generated by java, not by octave, so I doubt there is anything you can do from within octave to turn it off.

Effectively what it means is that, presumably io (or the particular function from the io package that you're using) relies on the java interface , and somehow the java command is run with a -D property set up as stated in your warning (ie, presumably java -Djava.system.class.loader="org.octave.OctClassLoader"... ).

The following excerpt from the manual may be relevant for you:

You can specify options for the creation of the JVM inside a file named java.opts. This is a text file where enter you enter lines containing -X and -D options that are then passed to the JVM during initialization.

The directory where the Java options file is located is specified by the environment variable OCTAVE_JAVA_DIR. If unset the directory where javaclasspath.m resides is used instead (typically OCTAVE_HOME/share/octave/OCTAVE_VERSION/m/java/). You can find this directory by executing

which javaclasspath

This seems to have been fixed in Octave bug #55174 .

Hackish workaround (binary-edit an Octave library):

cp -ai /usr/lib/x86_64-linux-gnu/liboctinterp.so.7.0.1 a
bbe -e 's/-Djava.system.class.loader=org.octave.OctClassLoader/-Dfoo=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/' a > b
ls -l a b  # Make sure the binary edit did not change the file length!
chmod 644 b
sudo cp -ai b /usr/lib/x86_64-linux-gnu/liboctinterp.so.7.0.1
sudo chown root.root /usr/lib/x86_64-linux-gnu/liboctinterp.so.7.0.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM