java.lang.RuntimeException: File /export/home/gtee/ramesh/swing.jar does not belong to /export/home/gtee/ramesh/jars at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:63) at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:83)

JDK Bug System | Ramesh Gangadhar | 7 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Please find the attachment Contains ChrisTest.java ISSUE: If “MainJar” is mentioned via RelativeFileSet then mainJar is not picked from BaseDirectory instead it is picked from current working directory Here is the snippet code of ChrisTest.java <SNIPPET> hashMap.put(BundleParams.PARAM_NAME, "SimpleExecutablesTest"); hashMap.put(BundleParams.PARAM_APPLICATION_CLASS, "java8.SwingHello"); hashMap.put(StandardBundlerParam.CLASSPATH.getID(), "swing.jar"); hashMap.put(StandardBundlerParam.SOURCE_DIR.getID(), "/export/home/gtee/ramesh/jars"); Path jarFolder = Paths.get("/export/home/gtee/ramesh/jars"); hashMap.put(StandardBundlerParam.MAIN_JAR.getID(), new RelativeFileSet(jarFolder.toFile(), new HashSet<>(Arrays.asList(new File( "swing.jar"))))); List<Path> list = new ArrayList<>(); list.add(jarFolder); try (DirectoryStream<Path> jarsStream = Files.newDirectoryStream(jarFolder, "*.jar")) { List<Path> jars = new ArrayList<>(); jarsStream.forEach(jars::add); hashMap.put(BundleParams.PARAM_APP_RESOURCES, new RelativeFileSet(jarFolder.toFile(), jars.stream() .map(Path::toFile).collect(Collectors.toSet()))); System.out.println("parameters are " + hashMap); System.out.println( "=========================Execution STARTS============================"); File returnValue = macAppBundler.execute(hashMap, new File("output")); System.out.println("Return value of execute is " + returnValue); System.out.println( "=========================Execution ENDS============================"); } </SNIPPET> stt-mac-42:ramesh gtee$ pwd /export/home/gtee/ramesh <======================== current working directory================== stt-mac-42:ramesh gtee$ ls antfiles appbundler_repo jdk9developerbuild moduleresource rameshoutdir apache-ant-1.9.7 appbundler_repo.zip modjars moduleresource.zip result apache-ant-1.9.7-bin.zip jars modsource outdir stt-mac-42:ramesh gtee$ java -cp /export/home/gtee/ramesh/moduleresource/readmodbin testapp.ChrisTest Mac Execution With Relative FileSet Exception in thread "main" java.lang.RuntimeException: File /export/home/gtee/ramesh/swing.jar does not belong to /export/home/gtee/ramesh/jars at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:63) at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:83) at testapp.ChrisTest.mac(ChrisTest.java:51) at testapp.ChrisTest.main(ChrisTest.java:28) stt-mac-42:ramesh gtee$ javac -d /export/home/gtee/ramesh/moduleresource/readmodbin /export/home/gtee/ramesh/moduleresource/readmodsrc/testapp/ChrisTest.java stt-mac-42:ramesh gtee$ java -cp /export/home/gtee/ramesh/moduleresource/readmodbin testapp.ChrisTest Mac Execution With Relative FileSet Exception in thread "main" java.lang.RuntimeException: File /export/home/gtee/ramesh/swing.jar does not belong to /export/home/gtee/ramesh/jars at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:63) at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:83) at testapp.ChrisTest.mac(ChrisTest.java:51) at testapp.ChrisTest.main(ChrisTest.java:28)

    JDK Bug System | 7 months ago | Ramesh Gangadhar
    java.lang.RuntimeException: File /export/home/gtee/ramesh/swing.jar does not belong to /export/home/gtee/ramesh/jars at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:63) at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:83)

    Root Cause Analysis

    1. java.lang.RuntimeException

      File /export/home/gtee/ramesh/swing.jar does not belong to /export/home/gtee/ramesh/jars at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:63) at com.oracle.tools.packager.RelativeFileSet.<init>(jdk.packager/RelativeFileSet.java:83)

      at testapp.ChrisTest.mac()
    2. testapp
      ChrisTest.main
      1. testapp.ChrisTest.mac(ChrisTest.java:51)
      2. testapp.ChrisTest.main(ChrisTest.java:28)
      2 frames