facebook

Run/Debug Errors with JDK 11.0.4 Error: Could not find or load main class

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #627796 Reply

    Walter Scheper
    Participant

    After migrating a working Vendor SDK based project with a complex classpath from 1.8.0 to 11.0.4 using compliance level 11 most run configurations are failing. I reverted changes and restored use of 1.8.0 and everything works. Change preferences to use 11.0.4 and compliance level 11 and again fails same issue.

    Message received:
    Error: Could not find or load main class CSDW\CSDWBORepository\bin;C:\lib\Apache\commons-lang3-3.7\commons-lang3-3.7.jar;C:\usr\MyEclipse\WorkSpace
    Caused by: java.lang.ClassNotFoundException: CSDW\CSDWBORepository\bin;C:\lib\Apache\commons-lang3-3/7\commons-lang3-3/7/jar;C:\usr\MyEclipse\WorkSpace

    There is a major difference in the Run Commands between these JDKS.

    With JDK 1.8.0_201
    C:\Program Files\Java\jdk1.8.0_201\bin\javaw.exe -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:52137 “-Dlog4j.configuration=src\log4jConfig.xml” -Xms1024M -Xmx1024M -Djava.net.preferIPv4Stack=true “-javaagent:C:\usr\MyEclipse CI\configuration\org.eclipse.osgi\853\0\.cp\lib\javaagent-shaded.jar” -Dfile.encoding=Cp1252 us.nc.state.dhhs.csdw.businessobjects.repository.RefreshRepository wv1hhcsdwAP01d:6400

    With JDK 11.0.4
    C:\usr\MyEclipse CI\binary\com.sun.java.jdk11.win32.x86_64_1.11.2\bin\javaw.exe -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:53420 “-Dlog4j.configuration=src\log4jConfig.xml” -Xms1024M -Xmx1024M -Djava.net.preferIPv4Stack=true “-javaagent:C:\usr\MyEclipse CI\configuration\org.eclipse.osgi\853\0\.cp\lib\javaagent-shaded.jar” -Dfile.encoding=Cp1252 “@C:\usr\MyEclipse\WorkSpace CSDW\CSDWBORepository\.temp-RefreshRepositoryDev-classpath-arg-1570715104463.txt” us.nc.state.dhhs.csdw.businessobjects.repository.RefreshRepository wv1hhcsdwAP01d:6400

    It appears classpath is now set in 11.0.4 by temp file using “@C:\usr\MyEclipse\WorkSpace CSDW\CSDWBORepository\.temp-RefreshRepositoryDev-classpath-arg-1570715104463.txt”

    This file starts as follows notice the unquoted path (attached file below):
    -classpath C:\usr\MyEclipse\WorkSpace CSDW\CSDWBORepository\bin;C:\lib\Apache\commons-lang3-3.7\commons-lang3-3.7.jar;C:\usr\MyEclipse\WorkSpace CSDW\Apache Commons Lang\bin;

    The failure is occurring with the first non-quoted classpath entry resulting in the execution using CSDW\CSDWBORepository\bin; as the main class.

    I haven’t been able to find an option to force quoting of this generated classpath.

    Attachments:
    You must be logged in to view attached files.
    #627798 Reply

    Walter Scheper
    Participant

    *** Date:
    Thursday, October 10, 2019 at 10:10:37 AM Eastern Daylight Time

    *** System properties:
    OS=Windows10
    OS version=10.0.0
    OS arch=amd64
    Profile arch=x86_64
    Window system=win32
    Java version=11.0.2
    Workspace=file:/C:/usr/MyEclipse/WorkSpace CSDW/
    VM Args=-Xms256m
    -Xmx1024m
    -XX:+UseG1GC
    -XX:+UseStringDeduplication
    -Dosgi.requiredJavaVersion=1.8
    -Dosgi.nls.warnings=ignore
    -Davailable.updates.autoexpand=true
    –add-modules=ALL-SYSTEM
    -jar
    C:\usr\MyEclipse CI\\plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar

    *** Subscription information
    Product Id: E3MP (MyEclipse Professional Subscription)
    License version: 3.0
    Full Maintenance Included
    Subscription expiration date (YYYYMMDD): 20200925
    Number of users: 1

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: CI 2019.4.0
    Build id: 16.0.0-20190403

    com.genuitec.myeclipse.blue.feature – 14.0.0.me201904021204
    com.genuitec.myeclipse.database – 15.0.1.me201904021204
    com.genuitec.myeclipse.db2 – 15.0.1.me201904021204
    com.genuitec.myeclipse.desktop – 14.0.0.me201904021204
    com.genuitec.myeclipse.enterprise.workbench – 14.0.0.me201904021204
    com.genuitec.myeclipse.icefaces.feature – 14.0.0.me201904021204
    com.genuitec.myeclipse.imageeditor – 14.0.0.me201904021204
    com.genuitec.myeclipse.jsf – 14.0.0.me201904021204
    com.genuitec.myeclipse.maven – 14.0.0.me201904021204
    com.genuitec.myeclipse.persistence – 14.0.0.me201904021204
    com.genuitec.myeclipse.reports – 14.0.0.me201904021204
    com.genuitec.myeclipse.struts – 14.0.0.me201904021204
    com.genuitec.myeclipse.uml2 – 14.0.0.me201904021204
    com.genuitec.myeclipse.visualvm – 14.0.0.me201904021204
    com.genuitec.myeclipse.ws – 14.0.0.me201904021204
    com.genuitec.myeclipse.ws.blue – 14.0.0.me201904021204
    com.skyway.myeclipseforspring.feature – 15.0.1.me201904021204
    org.eclipse.birt – 4.8.0.me201904021204
    org.eclipse.datatools.connectivity.feature – 1.14.101.me201904021204
    org.eclipse.datatools.enablement.feature – 1.14.101.me201904021204
    org.eclipse.datatools.modelbase.feature – 1.14.101.201811012051
    org.eclipse.datatools.sqldevtools.feature – 1.14.101.me201904021204
    org.eclipse.emf – 2.16.0.v20181206-1055
    org.eclipse.gef – 3.11.0.201606061308
    org.eclipse.graphiti.feature – 0.15.0.201806050830
    org.eclipse.jpt.jpa.feature – 3.5.101.me201904021204
    org.eclipse.jpt.jpadiagrameditor.feature – 1.2.300.me201904021204
    org.eclipse.jst.common.fproj.enablement.jdt – 3.11.0.me201904021204
    org.eclipse.jst.enterprise_ui.feature – 3.9.2.me201904021204
    org.eclipse.jst.server_adapters.ext.feature – 3.3.602.me201904021204
    org.eclipse.jst.server_adapters.feature – 3.2.500.me201904021204
    org.eclipse.jst.server_ui.feature – 3.4.300.me201904021204
    org.eclipse.jst.ws.axis2tools.feature – 1.1.301.me201904021204
    org.eclipse.m2e.feature – 1.10.0.me201904021204
    org.eclipse.sapphire.platform – 9.1.1.201712191343
    org.eclipse.wst.common.fproj – 3.7.2.me201904021204
    org.eclipse.wst.server_adapters.feature – 3.2.700.me201904021204
    org.eclipse.xsd – 2.16.0.v20181127-0852
    org.springframework.ide.eclipse.feature – 3.9.7.me201904021204

    angularjs-eclipse-feature – 1.2.0.me201904021204
    angularjs-eclipse-jsp-feature – 1.2.0.me201904021204
    angularjs-eclipse-php-feature – 1.2.0.me201904021204
    com.eclipsesource.j2v8.feature – 4.0.0.201704121300
    com.github.eclipsecolortheme.feature – 1.0.0.me201904021204
    com.vmware.vfabric.ide.eclipse.tcserver – 3.9.7.201812201029-RELEASE
    com.vmware.vfabric.ide.eclipse.tcserver.insight – 3.9.7.me201904021204
    fr.obeo.acceleo.bridge.feature – 2.6.0.me201904021204
    io.emmet.eclipse – 14.0.0.me201904021204
    net.jeeeyul.pdetools.feature – 1.2.9.me201904021204
    net.jeeeyul.swtend.feature – 2.2.5.me201904021204
    org.chromium.debug – 0.3.9.201903271144
    org.chromium.sdk – 0.3.9.201903271144
    org.chromium.sdk.wipbackends – 0.1.11.201903271144
    org.dadacoalition.yedit.feature – 1.0.18.201903271150
    org.eclipse.buildship – 3.0.0.v20181106-1441-m
    org.eclipse.cvs – 1.4.700.v20181206-0815
    org.eclipse.draw2d – 3.10.100.201606061308
    org.eclipse.e4.rcp – 1.6.300.v20181204-1801
    org.eclipse.ecf.core.feature – 1.5.3.v20181012-2020
    org.eclipse.ecf.core.ssl.feature – 1.1.100.v20180301-0201
    org.eclipse.ecf.filetransfer.feature – 3.14.4.v20181013-2146
    org.eclipse.ecf.filetransfer.httpclient4.feature – 3.14.4.v20181013-2146
    org.eclipse.ecf.filetransfer.httpclient4.ssl.feature – 1.1.100.v20180301-0132
    org.eclipse.ecf.filetransfer.ssl.feature – 1.1.100.v20180301-0132
    org.eclipse.egit – 5.2.0.201812061821-r
    org.eclipse.epp.mpc – 1.7.3.v20181205-1546
    org.eclipse.equinox.p2.core.feature – 1.6.0.v20181123-1405
    org.eclipse.equinox.p2.discovery.feature – 1.2.100.v20180822-1357
    org.eclipse.equinox.p2.extras.feature – 1.4.200.v20181123-1405
    org.eclipse.equinox.p2.rcp.feature – 1.4.200.v20181123-1405
    org.eclipse.equinox.p2.user.ui – 2.4.200.v20181123-1405
    org.eclipse.help – 2.2.400.v20181206-0815
    org.eclipse.jdt – 3.16.0.v20181206-1038
    org.eclipse.jet – 1.1.1.v201101271243-5319sC7HCAGERASDK3924
    org.eclipse.jet.uml2 – 1.1.0.v201006011447-2-07w311A1A152813
    org.eclipse.jgit – 5.2.0.201812061821-r
    org.eclipse.jgit.ssh.apache – 5.2.0.201812061821-r
    org.eclipse.jsf.feature – 3.10.0.me201904021204
    org.eclipse.mylyn.bugzilla_feature – 3.24.2.v20180905-0003
    org.eclipse.mylyn.commons – 3.24.2.v20180904-2231
    org.eclipse.mylyn.commons.identity – 1.16.0.v20180904-2231
    org.eclipse.mylyn.commons.notifications – 1.16.0.v20180904-2231
    org.eclipse.mylyn.commons.repositories – 1.16.0.v20180904-2231
    org.eclipse.mylyn.context_feature – 3.24.2.v20180905-0014
    org.eclipse.mylyn.cvs – 1.16.0.v20170629-1738
    org.eclipse.mylyn.discovery – 3.24.2.v20180904-2231
    org.eclipse.mylyn.gerrit.feature – 2.15.0.v20180322-1946
    org.eclipse.mylyn.git – 1.16.0.v20170629-1738
    org.eclipse.mylyn.ide_feature – 3.24.2.v20180905-0014
    org.eclipse.mylyn.java_feature – 3.24.2.v20180905-0014
    org.eclipse.mylyn.monitor – 3.24.2.v20180904-2231
    org.eclipse.mylyn.reviews.feature – 2.15.0.v20180905-0015
    org.eclipse.mylyn.tasks.ide – 3.24.2.v20180905-0003
    org.eclipse.mylyn.team_feature – 3.24.2.v20180905-0014
    org.eclipse.mylyn.versions – 1.16.0.v20170629-1738
    org.eclipse.mylyn_feature – 3.24.2.v20180905-0003
    org.eclipse.ocl – 3.1.0.v20110606-1427
    org.eclipse.pde – 3.13.300.v20181206-0815
    org.eclipse.platform – 4.10.0.v20181206-0815
    org.eclipse.rcp – 4.10.0.v20181206-0815
    org.eclipse.tm.terminal.connector.local.feature – 4.5.1.201811011802
    org.eclipse.tm.terminal.connector.ssh.feature – 4.5.1.201811011802
    org.eclipse.tm.terminal.connector.telnet.feature – 4.5.1.201811011802
    org.eclipse.tm.terminal.control.feature – 4.5.1.201811011802
    org.eclipse.tm.terminal.feature – 4.5.1.201811011802
    org.eclipse.tm.terminal.view.feature – 4.5.1.201811011802
    org.eclipse.userstorage – 1.1.0.v20170526-1605
    org.eclipse.wb.core.feature – 1.9.2.201812270937
    org.eclipse.wb.core.java.feature – 1.9.2.201812270937
    org.eclipse.wb.core.ui.feature – 1.9.2.201812270937
    org.eclipse.wb.core.xml.feature – 1.9.2.201812270937
    org.eclipse.wb.doc.user.feature – 1.9.2.201812270937
    org.eclipse.wb.layout.group.feature – 1.9.2.201812270937
    org.eclipse.wb.rcp.SWT_AWT_support – 1.9.2.201812270937
    org.eclipse.wb.rcp.doc.user.feature – 1.9.2.201812270937
    org.eclipse.wb.rcp.feature – 1.9.2.201812270937
    org.eclipse.wb.swing.doc.user.feature – 1.9.2.201812270937
    org.eclipse.wb.swing.feature – 1.9.2.201812270937
    org.eclipse.wb.swt.feature – 1.9.2.201812270937
    org.eclipse.wb.xwt.feature – 1.9.2.201812270937
    org.sonatype.m2e.mavenarchiver.feature – 0.17.2.201606141937-signed-20160830073346
    tern-feature – 1.2.0.201903271146
    tern-jsdt-feature – 1.2.0.201903271146
    tern-linters-feature – 1.2.0.201903271146
    tern-server-nodejs-feature – 1.2.0.me201904021204
    tern.eclipse.ide.server.nodejs.embed – 1.2.0.201903271146

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86_64
    -showsplash
    -launcher
    C:\usr\MyEclipse CI\myeclipse.exe
    -name
    Myeclipse
    –launcher.library
    C:\usr\MyEclipse CI\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.900.v20180922-1751\eclipse_1801.dll
    -startup
    C:\usr\MyEclipse CI\\plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar
    –launcher.overrideVmargs
    -exitdata
    27090_10c
    -configuration
    C:\usr\MyEclipse CI\configuration
    -install
    C:\usr\MyEclipse CI
    -vm
    C:\usr\MyEclipse CI\binary\com.sun.java.jdk11.win32.x86_64_1.11.2\bin\javaw.exe

    #627806 Reply

    Brian Fernandes
    Moderator

    Walter,

    Thanks for providing all the details upfront. The ability to specify long arguments via an external file was introduced in Java 9, and it seems clear that the absence of quotes is causing the problem – though surprising that these are still required for arguments in an external file.

    Examining the command line for Java 8, how was the classpath being provided in that case?

    This is a core Eclipse capability and so far I have been unable to locate documentation that will help, but we’re still looking.

    One option I can immediately think of would be to make a copy of your automatically generated classpath file (A) and modify it by adding quotes as required. Then in the launch configuration, delete all the items under Classpath Entries on the Dependencies tab – this should prevent the configuration from trying to generate a classpath argument/file. You can now add A as a program argument. I haven’t tried this and it’s not a great solution as your classpath could change, but it might help you keep going for now.

    #627810 Reply

    Walter Scheper
    Participant

    Brian,
    Thank you for the quick response and for the work-around. I will move forward with testing it. I will monitor for any feedback you get from Eclipse.org.

    On Java 8 about class path is a good question. The command line generated was
    C:\Program Files\Java\jdk1.8.0_201\bin\javaw.exe -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:52137 “-Dlog4j.configuration=src\log4jConfig.xml” -Xms1024M -Xmx1024M -Djava.net.preferIPv4Stack=true “-javaagent:C:\usr\MyEclipse CI\configuration\org.eclipse.osgi\853\0\.cp\lib\javaagent-shaded.jar” -Dfile.encoding=Cp1252 us.nc.state.dhhs.csdw.businessobjects.repository.RefreshRepository wv1hhcsdwAP01d:6400

    There is no explicitly defined classpath that I can see or find. There is a suspicious use of a -javaagent set to javaagent-shaded.jar. That jar has today’s date and time. I see in same location a launchingsupport.jar with current date and time. My best guess is a dynamically set classpath from the run config in Eclipse by these components.

    What I can quickly determine of a -javaagent is
    “A low-level software component to augment the working of a JVM, such as profilers, code-coverage tools, etc”

    #627813 Reply

    Walter Scheper
    Participant

    Brian,
    I was unable to make the work-around work. It insisted on building the temp file with the classpath.

    I analyzed the path with spaces and saw there were two sources:
    1. Workspace was named “WorkSpace CSDW”. I exited MyEclipse and renamed it “WorkSpaceCSDW”. Opened MyEclipse and ran a clean on all projects.
    2. The vendor’s SDK jars were located in C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\

    I created a NTFS softlink for this “sapbo_lib” in my primary library path c:\lib and editted the .classpath to replace all occurrences of the path to c:/lib/sapbo_lib

    After running another clean on project I was able to run and debug as usual.

    Ugly to have this type of regression when moving between JDKs.

    #627877 Reply

    Brian Fernandes
    Moderator

    Walter,

    Thanks for getting back, I’m glad it was relatively easy to remove spaces from your classpath list (I did not even want to suggest it!).

    I was able to replicate the problem here, in Eclipse 2019-09, and it clearly looks like a JDT bug (if the file is not generated because there are only a few JARs, they do quote the -classpath argument). So I’ve filed this as a bug against the JDT: https://bugs.eclipse.org/bugs/show_bug.cgi?id=552037 do comment and/or vote so it gets their attention.

    Finally, I’m surprised the “remove everything from classpath” suggestion did not work – it did for me, but it’s likely that you have other resources that need to be removed as well. Anyway, it does not matter now, and hopefully they will fix the issue soon.

    Thanks again for the report and have a great weekend!

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Run/Debug Errors with JDK 11.0.4 Error: Could not find or load main class

You must be logged in to post in the forum log in