acould not find the main class 不能发现大类[translate]
publicclassHelloWorld{publicstaticvoidmain(String[]args){System.out.println("Hello, World!");}} 1. 2. 3. 4. 5. 在上面的示例中,HelloWorld是主类,其中包含main方法。程序运行时,通过这个方法开始执行。 常见原因导致 “Could not find the main class” 错误 类名拼写错误 如果你在命令行中输入的类名...
{一}动机 最近自己写了个小应用,用于生成子系统树需要的配置信息,打包为可执行jar发给其他同事使用时双击jar包提示“could not find the main class”. 首先当然要检查一下JRE环境等,经过一番折腾整理如下几项注意点(首先说明一下是在windows7): {二}问题分析 {1}确认jar输出方式 确认jar输入方式是不是不小心...
出现Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 错误的原因,是因为我们使用高版本的JDK编译的Java class文件试图在较低版本的JVM上运行,所报的错误。 因为,高版本的JDK生成的class文件使用的格式,可能与低版本的JDK的.class文件格式不同。这样,低版本的JVM无法解释执行...
Could not find the main class之包名冲突解决 1 新建了java类,发现如下图错误,无法编译通过,检查了好久,才知道是项目的package name(包名)产生冲突了。 图1 修改前 解决方法:不能把项目package name(包名) 写成以java开头,修改成其他即可,如java2,com...等等. 图2 修改后 ...
1JAVAEclipse:could not find the main class,program will exit!我在Eclipse中写了以下一个程序:import java.awt.*;import javax.swing.*;import javax.swing.tree.*;import javax.swing.event.*;//森林状的关系图public class JTreeDemoextends JFrame{ JTextField jtfInfo; //文本域,用于显示点击的节点名称...
安装java的时候出现Could not find the main class.program will exit,如果code和环境变量配置没有错误。最可能的原因是jdk与jre的版本不对。例如用jdk1.7编写的code,如果用jvm1.6去运行,将会出现RT
eclipse+tomcat报错could not find the main class:org.apache.catalina.startup.Bootstrapjava.lang.UnsatisfiedLinkError: java.util.zip.ZipFile.open(Ljava/lang/String;IJZ)J\5at java.util.zip.ZipFile.open(Native Method)\5at java.util.zip.ZipFile.(Unknown Source)...
1、首先打开MyEclipse,在该页面中,点击打开主菜单中的Windows选项。2、然后在弹出来的窗口中点击打开“Proferences”选项。3、然后在弹出来的窗口中点击打开“java compiler”选项。4、然后在弹出来的窗口中将编译器的JDK版本改为1.7的。如果安装的jre是1.6的则将这个改为1.6,根据自身的版本将JDK...
我有一个 java 项目,从 Eclipse 中运行它时,它运行得非常好。当我尝试将其导出到"JAR file"或"Runnable JAR file"时,创建了 .jar 文件,但是当我双击它以尝试运行程序时,它给我一个错误说 "Couldnotfindthe main class: package.MainClassName. Program willexit." ...