问题描述
我正在JavaFX中创建一个项目,当我创建一个新项目时,它给了我一个名为sample的包。 我决定不使用包装,将所有类剪切并粘贴到src包中,并制作了fxml文件。 我收到一个错误,看起来像Java在寻找示例包,但我删除了它。 我在代码中找不到任何显示引用到的示例的任何内容。 有任何想法吗?
"C:\Program Files\Java\jdk1.8.0_31\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\bin" -Dfile.encoding=windows-1252 -classpath "C:\Program Files\Java\jdk1.8.0_31\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\zipfs.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\alloy.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\annotations.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\asm-all.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\asm-commons.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\asm-tree-3.0.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\asm.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\asm4-all.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\automaton.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\batik.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\boot.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\bootstrap.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\cglib-2.2.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\cli-parser-1.1.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\commons-codec-1.8.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\commons-httpclient-3.1-patched.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\commons-logging-1.1.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\commons-net-3.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\ecj-4.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\extensions.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\fluent-hc-4.3.6.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\forms_rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\freemarker.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\fxHelpBrowser.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\groovy-all-2.3.9.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\gson-2.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\guava-17.0.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\hamcrest-core-1.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\hamcrest-library-1.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\httpclient-4.3.6.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\httpcore-4.3.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\httpmime-4.3.6.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\icons.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\idea-jsp-openapi.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\idea.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\ideax.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\idea_rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\isorelax.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jasper21_rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jasper2_rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\javac2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jaxen-1.1.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jayatana-1.2.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jcip-annotations.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jdkAnnotations.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jdom.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jettison-1.3.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jgoodies-common-1.2.1.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jgoodies-forms.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jgoodies-looks-2.4.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jh.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jing.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jna-utils.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jna.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jps-launcher.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jps-model.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jps-server.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsch-0.1.51.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsch.agentproxy.connector-factory.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsch.agentproxy.core.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsch.agentproxy.pageant.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsch.agentproxy.sshagent.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsch.agentproxy.usocket-jna.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsch.agentproxy.usocket-nc.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsp-api.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsr166e.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jsr173_1.0_api.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\junit-4.11.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\jzlib-1.1.1.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\log4j.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\markdown4j-2.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\markdownj-core-0.4.2-SNAPSHOT.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\microba.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\miglayout-swing.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\nanoxml-2.2.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\nekohtml-1.9.14.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\netty-all-4.1.0.Beta4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\openapi.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\optimizedFileManager.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\oromatcher.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\picocontainer.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\protobuf-2.5.0.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\proxy-vole_20131209.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\pty4j-0.4.15.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\purejavacomm.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\resolver.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\resources.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\resources_en.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\rhino-js-1_7R4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\rngom-20051226-patched.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\sanselan-0.98-snapshot.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\serviceMessages.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\servlet-api.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\slf4j-api-1.7.10.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\slf4j-log4j12-1.7.10.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\snappy-in-java-0.3.1.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\swingx-core-1.6.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\trang-core.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\trove4j.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\trove4j_src.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\util.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\velocity.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\winp-1.21-patched.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\xbean.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\xerces.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\xml-apis.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\xmlrpc-2.0.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\xpp3-1.1.4-min.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\xstream-1.4.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\lib\yjp-controller-api-redist.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\JavaEE\lib\gradle-javaee.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\JavaEE\lib\IntelliLang-javaee.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\JavaEE\lib\javaee-openapi.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\JavaEE\lib\resources_en.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\PersistenceSupport\lib\persistence-openapi.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\PersistenceSupport\lib\resources_en.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\DatabaseTools\lib\database-openapi.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\DatabaseTools\lib\jdba.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\DatabaseTools\lib\resources_en.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\CSS\lib\css-openapi.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\CSS\lib\resources_en.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\uml\lib\diagram-api.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\Spring\lib\spring-aop.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\Spring\lib\spring-api.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\Spring\lib\spring-eclipse.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\plugins\Spring\lib\spring-web.jar;C:\Users\Ethan\workspace\CSC 275 Final\out\production\CSC 275 Final" com.intellij.rt.execution.application.AppMain sample.Main
Exception in thread "main" java.lang.ClassNotFoundException: sample.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
Process finished with exit code 1
1楼
似乎项目配置存在一些问题。 因此,在IDEA中尝试:“ Run”->“ EditConfiguration”并检查您的设置。
如果左侧没有任何类名(例如我的MainSTE,MainSCI),则只需添加:“ +”->“ Application”,然后指定类名(屏幕截图中带下划线的按??钮)