JDK-8158928 : Test tools/pack200/Pack200Test.java compilation failed
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2016-06-07
  • Updated: 2016-09-02
  • Resolved: 2016-09-02
Related Reports
Duplicate :  
Description
Test tools/pack200/Pack200Test.java fails during compilation:

error: unreported exception Exception; must be caught or declared to be thrown
        jarList.add(Utils.createRtJar());
                                     ^
1 error

TEST RESULT: Failed. Compilation failed: Compilation failed

The problem is that Utils.createRtJar has more wider exception specification than Pack200Test.main.

static File createRtJar(String pattern) throws Exception

and

public static void main(String[] args) throws IOException

Comments
This is a trivial fix and will be addressed by JDK-8151901
02-09-2016

There are some inherent issues regarding this test case (JDK-8151901). This compilation error should be fixed along with the underlying issue.
13-06-2016

This is on the exclude list (ProblemList.txt) so not clear why is is run.
07-06-2016