Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8190538

corba becomes invisible from classpath when adding --add-modules option in JDK9

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 9
    • Fix Version/s: None
    • Component/s: other-libs

      Description

      Unable to import classes transaction.UserTransaction and
      corba.SystemException in a simple program after upgrading to JDK9. After
      finding that the UserTransaction class is missing from the
      user.transaction.jmod module, tried adding the transaction jar to the
      classpath. But found that to import another class corba.SystemException
      needed to use the "--add-modules java.corba" option. This caused the
      transaction jar to no longer be visible on the classpath and give an error of
      cannot find symbol.

      # javac -cp
      /opt/cellsrv/deploy/modules/javax.transaction_1.0.0.0_1-1.jar
      HelloWorld.java
      HelloWorld.java:2: error: package org.omg.CORBA is not visible
      import org.omg.CORBA.SystemException;
                    ^
        (package org.omg.CORBA is declared in module java.corba, which is not in
      the module graph)
      1 error
      # javac --add-modules java.corba -cp
      /opt/cellsrv/deploy/modules/javax.transaction_1.0.0.0_1-1.jar
      HelloWorld.java
      HelloWorld.java:1: error: cannot find symbol
      import javax.transaction.UserTransaction;
                              ^
        symbol: class UserTransaction
        location: package javax.transaction
      1 error

      HelloWorld.java Program:

      import javax.transaction.UserTransaction;
      import org.omg.CORBA.SystemException;

      public class HelloWorld {
          public static void main(String[] args) {
              System.out.println("Hello, World");
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              robm Robert Mckenna
              Reporter:
              shadowbug Shadow Bug
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: