girtel / Net2Plan

Net2Plan is a free and open-source Java tool devoted to the planning, optimization and evaluation of communication networks. It has been originally thought as a tool to assist the teaching of communication networks courses. Eventually it has converted into a powerful network optimization and planning tool for the academia and industry, together with a growing repository of network planning resources.
BSD 2-Clause "Simplified" License
85 stars 38 forks source link

Can't start - Ubu2004 - Cannot cast to class #259

Open MightyMirko opened 3 years ago

MightyMirko commented 3 years ago

Hello,

first time using java - maybe the problem sits infront.

5.8.0-53-generic #60~20.04.1-Ubuntu SMP Thu May 6 09:52:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

java --version 
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode)

Start-Date: 2021-09-01  12:12:02
Commandline: apt upgrade
Requested-By: 
Upgrade: libqmi-proxy:amd64 (1.24.8-1, 1.28.6-1~20.04), libwbclient0:amd64 (2:4.11.6+dfsg-0ubuntu1.9, 2:4.11.6+dfsg-0ubuntu1.10), libqmi-glib5:amd64 (1.24.8-1, 1.28.6-1~20.04), samba-libs:amd64 (2:4.11.6+dfsg-0ubuntu1.9, 2:4.11.6+dfsg-0ubuntu1.10), libmm-glib0:amd64 (1.12.8-1, 1.16.6-2~20.04), libmbim-proxy:amd64 (1.22.0-2, 1.24.8-1~20.04), libsmbclient:amd64 (2:4.11.6+dfsg-0ubuntu1.9, 2:4.11.6+dfsg-0ubuntu1.10), thermald:amd64 (1.9.1-1ubuntu0.4, 1.9.1-1ubuntu0.5), modemmanager:amd64 (1.12.8-1, 1.16.6-2~20.04), libmbim-glib4:amd64 (1.22.0-2, 1.24.8-1~20.04)
End-Date: 2021-09-01  12:12:08

Start-Date: 2021-09-01  12:13:47
Commandline: apt install openjdk-11-jdk
Requested-By: 
Install: libpthread-stubs0-dev:amd64 (0.4-1, automatic), libice-dev:amd64 (2:1.0.10-0ubuntu1, automatic), libatk-wrapper-java:amd64 (0.37.1-1, automatic), libxt-dev:amd64 (1:1.1.5-1, automatic), libsm-dev:amd64 (2:1.2.3-1, automatic), xtrans-dev:amd64 (1.4.0-1, automatic), libxcb1-dev:amd64 (1.14-2, automatic), libatk-wrapper-java-jni:amd64 (0.37.1-1, automatic), x11proto-core-dev:amd64 (2019.2-1ubuntu1, automatic), libxau-dev:amd64 (1:1.0.9-0ubuntu1, automatic), openjdk-11-jdk:amd64 (11.0.11+9-0ubuntu2~20.04), openjdk-11-jre:amd64 (11.0.11+9-0ubuntu2~20.04, automatic), libxdmcp-dev:amd64 (1:1.1.3-0ubuntu1, automatic), fonts-dejavu-extra:amd64 (2.37-1, automatic), libx11-dev:amd64 (2:1.6.9-2ubun

:~/Downloads/Net2Plan-0.6.6.0$ java -jar Net2Plan-CLI.jar 
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')

com.net2plan.internal.SystemUtils.getClasspath(SystemUtils.java:173)
com.net2plan.internal.SystemUtils.configureEnvironment(SystemUtils.java:153)
com.net2plan.cli.CLINet2Plan.<init>(CLINet2Plan.java:51)
com.net2plan.cli.CLINet2Plan.main(CLINet2Plan.java:212)
robinchrist commented 2 years ago

I had the same issue. Try with Java 8, anything newer doesn't seem to work.

sudo apt install openjdk-8-jre
/usr/lib/jvm/java-8-openjdk-amd64/bin/java -jar Net2Plan.jar

For Ubuntu.

samuelenochog commented 10 months ago

@robinchrist any suggestions please: I now have both openJDK-8 and openJDK-17 installed. with 8, I once opened Net2Plan. But ever since it has failed to open both from GUI and CLI.

Antoniogins commented 10 months ago

@samuelenochog have you tried with the new release (0.7.0.1)? I fixed the class loading for newer JDK's, but if you don't manage to open it please tell me further details (some console print or anything that give me some details).

samuelenochog commented 10 months ago

@Antoniogins Thank you very much. Just tried the new release (0.7.0.1) and it is working with Oracle Java 17 runtime.