java出错!!求助!

Python015

java出错!!求助!,第1张

这是个外国网站的solution:http://forums.bukkit.org/threads/troubleshooting-common-problems-with-solution.44590/

内容是:

Full error:

java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.kernel32

at org.fusesource.jansi.internal.WindowsSupport.getConsoleMode<WindowsSupport.java:50

at jline.WindowsTerminal.getConsoleMode<WindowsTerminal.java:176>

at jline.WindowsTerminal.init<WindowsTerminal.java"80>

at jline.TerminalFactory.create<Terminalfactory.java:93>

at jline.TerminalFactory.get<TerminalFactory.java:151>

at jline.console.ConsoleReader.<init><ConsoleReader.java:140>

at jline.console.ConsoleReader.<init><ConsoleReader.java::126

at net .minecraft.server.MinecraftServer.<init><MinecraftServer.java:94>

at net.minecraft.server.MinecraftServer.main<MinecraftServer.java:624>

at org.bukkit.craftbukkit.Main.main<Main:136>

Press any key to continue . . .

This error is caused by you not having Visual C++ 2008 Redistributable installed, or having the wrong version installed that matches your Java version.

The version of Visual C++ 2008 Redistributable (x64 or x86) must match the version of Java you are using. If you are using Java x86 and have Visual C++ 2008 Redistributable x64 installed, it will not work. You must either use Java x64, or install Visual C++ 2008 Redistributable x86.

Alternatively, add in the -nojline option which turns off jline.

翻译过来的的大概意思就是:

你Visual C++ 2008 Redistributable没装,或者版本不对。

你的Java和那么Visual C++ 2008 Redistributable必须同时为x64版本,或者x86.

一个是64另一个是86的话,就会出错。

对象初始化

在类被装载、连接和初始化,这个类就随时都可能使用了。对象实例化和初始化是就是对象生命的起始阶段的活动,在这里我们主要讨论对象的初始化工作的相关特点。

Java 编译器在编译每个类时都会为该类至少生成一个实例初始化方法--即 "<init>()" 方法。此方法与源代码中的每个构造方法相对应,如果类没有明确地声明任何构造方法,编译器则为该类生成一个默认的无参构造方法,这个默认的构造器仅仅调用父类的无参构造器,与此同时也会生成一个与默认构造方法对应的 "<init>()" 方法.

通常来说,<init>() 方法内包括的代码内容大概为:调用另一个 <init>() 方法;对实例变量初始化;与其对应的构造方法内的代码。

如果构造方法是明确地从调用同一个类中的另一个构造方法开始,那它对应的 <init>() 方法体内包括的内容为:一个对本类的 <init>() 方法的调用;对应用构造方法内的所有字节码。

如果构造方法不是通过调用自身类的其它构造方法开始,并且该对象不是 Object 对象,那 <init>() 法内则包括的内容为:一个对父类 <init>() 方法的调用;对实例变量初始化方法的字节码;最后是对应构造子的方法体字节码。

如果这个类是 Object,那么它的 <init>() 方法则不包括对父类 <init>() 方法的调用。