-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
9
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");
}
}
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");
}
}