jjg@46: /* jjg@46: * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. jjg@46: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@46: * jjg@46: * This code is free software; you can redistribute it and/or modify it jjg@46: * under the terms of the GNU General Public License version 2 only, as jjg@46: * published by the Free Software Foundation. jjg@46: * jjg@46: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@46: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@46: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@46: * version 2 for more details (a copy is included in the LICENSE file that jjg@46: * accompanied this code). jjg@46: * jjg@46: * You should have received a copy of the GNU General Public License version jjg@46: * 2 along with this work; if not, write to the Free Software Foundation, jjg@46: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@46: * jjg@46: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, jjg@46: * CA 95054 USA or visit www.sun.com if you need additional information or jjg@46: * have any questions. jjg@46: */ jjg@46: jjg@46: /* jjg@46: * @test jjg@46: * @bug 6587786 jjg@46: * @summary Javap throws error : "ERROR:Could not find " for JRE classes jjg@46: */ jjg@46: jjg@46: import java.io.*; jjg@46: jjg@46: public class T6587786 { jjg@46: public static void main(String[] args) throws Exception { jjg@46: new T6587786().run(); jjg@46: } jjg@46: jjg@46: public void run() throws IOException { jjg@46: javap("com.sun.javadoc.Doc", "com.sun.crypto.provider.ai"); jjg@46: javap("com.sun.crypto.provider.ai", "com.sun.javadoc.ClassDoc"); jjg@46: } jjg@46: jjg@46: void javap(String... args) { jjg@46: StringWriter sw = new StringWriter(); jjg@46: PrintWriter out = new PrintWriter(sw); jjg@46: //sun.tools.javap.Main.entry(args); jjg@46: int rc = com.sun.tools.javap.Main.run(args, out); jjg@46: if (rc != 0) jjg@46: throw new Error("javap failed. rc=" + rc); jjg@46: out.close(); jjg@46: System.out.println(sw.toString()); jjg@46: } jjg@46: }