Rocket® Visual COBOL (formerly a Micro Focus® product)

 View Only
  • 1.  cannot run cobol jvm classes after update java 8_51 to java 8_131

    Posted 06-21-2017 16:46

    Hi everyone,

    I am doing some test from the recently published Visual Cobol ebook by Micro Focus, the test is simple, but I'm trying to understand what's is wrong when I upgrade the java 8 jdk version.

    • step 1 - create a HelloWorld.cbl with a simple sentence: display "Hello World"
    • step 2 - compile with cobol HelloWorld.cbl jvmgen;
    • step 3 - with java 8 update 51 run (from the Visual Cobol Command line 32 or 64 bits) the demo : java HelloWorld and runs ok
    • step 4 - uninstall java 8 update 51 and install java 8 update 131 (the latest), add the environment variables JAVA_HOME, CLASSPATH and add JAVA_HOME to the beginning of PATH variable
      • JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_131
      • CLASSPATH=%JAVA_HOME%\lib
      • PATH=%JAVA_HOME%\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\Aheredia\AppData\Local\Microsoft\WindowsApps;
    • step 5: start a visual cobol command line (32 bits or 64 bits) and try to run the demo:
      • java HelloWorld fail to run with message Error: Could not find or load main class HelloWorld

    Why I cannot update the java version on my system and keep running the jvm cobol classes? 

    regards,


    #JVMCOBOL
    #Java
    #Eclipse
    #VisualCOBOL


  • 2.  RE: cannot run cobol jvm classes after update java 8_51 to java 8_131
    Best Answer

    Posted 06-21-2017 17:00
    Hi Andres, I think your 'classpath' needs to include the current directory, so something like:
    CLASSPATH=.;%JAVA_HOME%\lib
    Regards,
    Robert.


  • 3.  RE: cannot run cobol jvm classes after update java 8_51 to java 8_131

    Posted 06-21-2017 17:10
    Hi Robert,

    what a rookie error! thanks for help me to notice that. I complety forgot that!

    thank you very much.


  • 4.  RE: cannot run cobol jvm classes after update java 8_51 to java 8_131

    Posted 06-21-2017 17:10
    Hi Robert,

    what a rookie error! thanks for help me to notice that. I complety forgot that!

    thank you very much.