2

https://jdk9.java.net/download/から jdk 9 をダウンロード し、 http://openjdk.java.net/projects/jigsaw/quick-start#linkerJigsaw からクイックスタート ガイドを ダウンロード して、最初の例「ご挨拶」を書きました。 "このガイドによると。プロジェクトは正常にコンパイルされましたが、実行しようとすると例外が発生しました

         E:\>java --module-path mods -m com.greetings/com.greetings.Main
    Error occurred during initialization of VM
    java.lang.module.ResolutionException: Error reading module: mods\com.greetings
    at java.lang.module.Resolver.findWithBeforeFinder(java.base@9-ea/Unknown Source)
    at java.lang.module.Resolver.resolveRequires(java.base@9-ea/Unknown Source)
    at java.lang.module.Configuration.resolveRequiresAndUses(java.base@9-ea/Unknown Source)
    at java.lang.module.ModuleDescriptor$1.resolveRequiresAndUses(java.base@9-ea/Unknown Source)
    at jdk.internal.module.ModuleBootstrap.boot(java.base@9-ea/Unknown Source)
    at java.lang.System.initPhase2(java.base@9-ea/Unknown Source)

    Caused by: java.lang.module.InvalidModuleDescriptorException: Main.class found in in top-level directory (unnamed package not allowed in module)
    at java.lang.module.ModuleInfo.invalidModuleDescriptor(java.base@9-ea/Unknown Source)
    at java.lang.module.ModuleInfo.read(java.base@9-ea/Unknown Source)
    at java.lang.module.ModuleDescriptor.read(java.base@9-ea/Unknown Source)
    at java.lang.module.ModulePath.readExplodedModule(java.base@9-ea/Unknown Source)
    at java.lang.module.ModulePath.readModule(java.base@9-ea/Unknown Source)
    at java.lang.module.ModulePath.scanDirectory(java.base@9-ea/Unknown Source)
    at java.lang.module.ModulePath.scan(java.base@9-ea/Unknown Source)
    at java.lang.module.ModulePath.scanNextEntry(java.base@9-ea/Unknown Source)
    at java.lang.module.ModulePath.find(java.base@9-ea/Unknown Source)
    at java.lang.module.ModuleFinder$2.lambda$find$0(java.base@9-ea/Unknown Source)
    at java.util.stream.ReferencePipeline$3$1.accept(java.base@9-ea/Unknown Source)
    at java.util.AbstractList$RandomAccessSpliterator.tryAdvance(java.base@9-ea/Unknown Source)
    at java.util.stream.ReferencePipeline.forEachWithCancel(java.base@9-ea/Unknown Source)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(java.base@9-ea/Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(java.base@9-ea/Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(java.base@9-ea/Unknown Source)
    at java.util.stream.FindOps$FindOp.evaluateSequential(java.base@9-ea/Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(java.base@9-ea/Unknown Source)
    at java.util.stream.ReferencePipeline.findFirst(java.base@9-ea/Unknown Source)
    at java.lang.module.ModuleFinder$2.find(java.base@9-ea/Unknown Source)
    at java.lang.module.Resolver.findWithBeforeFinder(java.base@9-ea/Unknown Source)
    at java.lang.module.Resolver.resolveRequires(java.base@9-ea/Unknown Source)
    at java.lang.module.Configuration.resolveRequiresAndUses(java.base@9-ea/Unknown Source)
    at java.lang.module.ModuleDescriptor$1.resolveRequiresAndUses(java.base@9-ea/Unknown Source)
    at jdk.internal.module.ModuleBootstrap.boot(java.base@9-ea/Unknown Source)
    at java.lang.System.initPhase2(java.base@9-ea/Unknown Source)

この例外の理由が見つかりませんでした

4

0 に答える 0