<div dir="ltr">Apparently the problem is this (from JDK 9 Release Notes[1]):<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The application class loader is no longer an instance of <code>java.net.URLClassLoader</code> (an implementation detail that was never specified in previous releases). Code that assumes that <code>ClassLoader::getSytemClassLoader</code> returns a <code>URLClassLoader</code>
 object will need to be updated. Note that Java SE and the JDK do not 
provide an API for applications or libraries to dynamically augment the 
class path at run-time.</blockquote><div><br></div><div>Consequently, the functions <addURL> and <getClassPath> in `modules/jvm/src/java/org/scilab/modules/jvm/ClassPath.java` fail because of the casting of ClassLoader to URLClassLoader. None of the class paths actually gets passed to the main code, and all hell ensues. I could get around this by manually passing paths to all the necessary *.jar files to _JAVA_OPTIONS. There is likely a better way, but so far it beats me.<br><br></div><div>Cheers.<br><br>[1] <a href="http://www.oracle.com/technetwork/java/javase/9-relnote-issues-3704069.html">http://www.oracle.com/technetwork/java/javase/9-relnote-issues-3704069.html</a><br></div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 February 2018 at 13:39, Atri Bhattacharya <span dir="ltr"><<a href="mailto:badshah400@gmail.com" target="_blank">badshah400@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Clément,<br>
<span class=""><br>
On Wed, 2018-02-21 at 15:25 +0000, Clément David wrote:<br>
> Hello Atri,<br>
><br>
> Thanks for your work on porting Scilab to jdk9 ;<br>
<br>
</span>You are welcome. It's mostly based on self-interest: I use scilab<br>
regularly (mostly on the command line though) on openSUSE Tumbleweed.<br>
<span class=""><br>
> this NoClassDefFoundError usually comes from a mis-<br>
> compilation check the jar content and be sure to load it correctly.<br>
<br>
</span>I think the jar content looks ok. I think it's some incompatibility<br>
between jdk 8 and 9 that prevents the classpath from being correctly<br>
used. The same binary works with jdk 8 (even though it is compiled<br>
against jdk 9) once the jre paths in the scilab script are<br>
appropriately adapted; but it doesn't with jdk 9.<br>
<span class=""><br>
> About the patches, I just<br>
> started to review them and will push them on the 6.0 branch after<br>
> fixing the build on my machine;<br>
<br>
</span>Many thanks. It will be great if these patches are upstreamed; it would<br>
certainly reduce my work (I maintain Scilab packages for openSUSE)<br>
during version upgrades.<br>
<br>
Best wishes.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> Le mercredi 21 février 2018 à 13:19 +0100, Atri Bhattacharya a écrit<br>
> :<br>
> > Hi,<br>
> > After several patches to fix building against java 9, I have been<br>
> > finally able to get scilab 6.0.1 building on openSUSE Tumbleweed.<br>
> > However, during run time, I now see a ClassNotFoundError, as<br>
> > follows:<br>
> > --------------------<br>
> > :~> SCIVERBOSE=1 scilab<br>
> > SCILABBIN : scilab-bin<br>
> > DISABLE_JAVA_DETECTION : 0<br>
> > SCILAB_MODE : gui<br>
> > OS : Linux<br>
> > MODEL : x86_64<br>
> > IS_SCILAB_BINARY : 0<br>
> > Using specified vm: /usr/lib64/jvm/java<br>
> > JAVA_HOME : /usr/lib64/jvm/java<br>
> > SCI : /usr/share/scilab/<br>
> > SCIBIN : /usr/bin/scilab-bin<br>
> > PATH :<br>
> > /usr/share/scilab/:/usr/share/<wbr>scilab//bin:/usr/bin:/home/<wbr>badshah400<br>
> > /bin<br>
> > :/usr/local/bin:/usr/bin:/bin:<wbr>/usr/lib/mit/bin:/usr/lib/mit/<wbr>sbin<br>
> > CLASSPATH :<br>
> > /usr/share/scilab//modules/<wbr>core/jar/org.scilab.modules.<wbr>core.jar<br>
> > EGL_DRIVER :<br>
> > LD_LIBRARY_PATH :<br>
> > /usr/lib64/jvm/java/lib/:/usr/<wbr>lib64/jvm/java/lib/server/:/<wbr>usr/lib64<br>
> > /jvm<br>
> > /java/lib/native_threads/<br>
> > DOCBOOK : /usr/share/xml/docbook/<wbr>stylesheet/nwalsh/current/<br>
> > WARNING: An illegal reflective access operation has occurred<br>
> > WARNING: Illegal reflective access by<br>
> > org.scilab.modules.jvm.<wbr>LibraryPath<br>
> > (file:/usr/share/scilab/<wbr>modules/jvm/jar/org.scilab.<wbr>modules.jvm.jar)<br>
> > to<br>
> > field java.lang.ClassLoader.sys_<wbr>paths<br>
> > WARNING: Please consider reporting this to the maintainers of<br>
> > org.scilab.modules.jvm.<wbr>LibraryPath<br>
> > WARNING: Use --illegal-access=warn to enable warnings of further<br>
> > illegal reflective access operations<br>
> > WARNING: All illegal access operations will be denied in a future<br>
> > release<br>
> > Could not access to the Main Scilab Class:<br>
> > Exception in thread "main" java.lang.<wbr>NoClassDefFoundError:<br>
> > org/scilab/modules/core/Scilab<br>
> > Caused by: java.lang.<wbr>ClassNotFoundException:<br>
> > org.scilab.modules.core.Scilab<br>
> >     at<br>
> > java.base/jdk.internal.loader.<wbr>BuiltinClassLoader.loadClass(<wbr>BuiltinC<br>
> > lass<br>
> > Loader.java:582)<br>
> >     at<br>
> > java.base/jdk.internal.loader.<wbr>ClassLoaders$AppClassLoader.<wbr>loadClass<br>
> > (Cla<br>
> > ssLoaders.java:185)<br>
> >     at<br>
> > java.base/java.lang.<wbr>ClassLoader.loadClass(<wbr>ClassLoader.java:496)<br>
> ><br>
> > Scilab cannot create Scilab Java Main-Class (we have not been able<br>
> > to<br>
> > find the main Scilab class. Check if the Scilab and thirdparty<br>
> > packages<br>
> > are available).<br>
> > --------------<br>
> ><br>
> > All patches are available at [1], and also documented on<br>
> > <a href="http://bugzilla.scilab.org/show_bug.cgi?id=15328" rel="noreferrer" target="_blank">http://bugzilla.scilab.org/<wbr>show_bug.cgi?id=15328</a><br>
> > where unfortunately, I have not seen the needle move much over the<br>
> > recent days.<br>
> ><br>
> > Scilab does work with java 1.8.0 (have to adapt the JRE paths<br>
> > appropriately in bin/scilab); however, as soon as java 9 is used<br>
> > the<br>
> > above error is manifested. If someone can help fix this issue, that<br>
> > will be very helpful.<br>
> ><br>
> > openSUSE uses Java 9 by default now, which means as of now scilab<br>
> > is<br>
> > badly broken -- only scilab-cli works -- on openSUSE Tumbleweed and<br>
> > soon to be released Leap 15.0. Unless Scilab's compatibility issues<br>
> > are<br>
> > fixed, we will have to drop it from the distro unfortunately.<br>
> ><br>
> > Thanks and best wishes.<br>
> ><br>
> > [1] <a href="https://build.opensuse.org/package/show/home:badshah400:branche" rel="noreferrer" target="_blank">https://build.opensuse.org/<wbr>package/show/home:badshah400:<wbr>branche</a><br>
> > s:science/scilab<br>
> ><br>
><br>
> ______________________________<wbr>_________________<br>
> dev mailing list<br>
> <a href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a><br>
> <a href="http://lists.scilab.org/mailman/listinfo/dev" rel="noreferrer" target="_blank">http://lists.scilab.org/<wbr>mailman/listinfo/dev</a><br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Atri Bhattacharya<br>
Thu 22 Feb 12:28:07 CET 2018<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
Sent from openSUSE Tumbleweed on my laptop.<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Atri </div>
</div>