Minecraft Coders Pack Errors when Running in Eclipse - java

Okay I am trying to make minecraft mods using eclipse. I used this video to set it up. I added both ModLoader and GuiApi to the Jar files before decompiling. It works until I try to test it in Eclipse then I get these errors:
Failed to load mod from "mod_HeroesGuild.class"
Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError
at net.minecraft.client.Minecraft.startGame(Minecraft.java:140)
at net.minecraft.client.Minecraft.run(Minecraft.java:438)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at net.minecraft.src.CanvasMojangLogo.<init>(CanvasMojangLogo.java:22)
at net.minecraft.src.PanelCrashReport.<init>(PanelCrashReport.java:103)
at net.minecraft.src.MinecraftImpl.displayUnexpectedThrowable(MinecraftImpl.java:26)
at net.minecraft.src.ModLoader.ThrowException(ModLoader.java:1612)
at net.minecraft.src.ModLoader.init(ModLoader.java:714)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:121)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:72)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:168)
... 3 more
I am new to programming and I don't have any idea what to do...
The run system starts minecraft the mojang logo appears but then I get a white screen! Thanks!

I found a forum where someone had the same error:
http://www.minecraftforum.net/topic/236195-crashing-after-mojang-logo-problem-solved/
The answer they give is to reinstall, via instructions at:
http://www.minecraftwiki.net/wiki/Tutorials/Minecraft_Help_FAQ#Reinstalling_Minecraft
...and the poster replies:
didn't think to delete the whole .minecraft.
Problem cured.
Remember to back it up first.
Underlying cause
I'm thinking your SDK is somehow loading from/conflicting with your existing Minecraft install.
This is because .minecraft is the folder under the Application Data folder that contains minecraft user/runtime data. Basically, your save game data, and the program's cached data.

Related

How to debug Java UNO in LibreOffice?

I have been researching on the topic for a couple of days and wrote a simple UNO component to work with the Spreadsheet. The main challenge I faced during the process is whenever the LO cannot find a class (i.e. some required jar is not included in the oxt package), the thread dies absolutely silently without throwing any exception. The only way to find out is to step trace all the suspecious code which is both frustrating and very time consuming. Only then can I see the exception message text and exception itself being created. Unfortunately, this exception is never really thrown in the environment I have or is silenced in some way.
Is there any way to enable LO to throw exceptions/see stack trace for debug purposes? Is there any location where LP puts java console output?
Any help is very much appreciated!
If you have not done so yet, I recommend getting the BookmarkInsertion example to work. Be sure that the application can find the main 4 jars in the classpath: juh.jar, jurt,jar, ridl,jar, unoil.jar.
Are you running the component from the Java IDE, for example, NetBeans?
Normally, build errors and exceptions are reported in the appropriate output window at the bottom of the IDE, and this is where java console output appears as well.
Otherwise, if you have already installed the OXT file in LibreOffice and are running it without a Java IDE, then there is no console output displayed. In that case, you may want to log to a file with something like log4j. However, error messages may still be able to pop up in a message box, depending on the error.
EDIT:
For an example in Eclipse, I followed the instructions at https://github.com/LibreOffice/loeclipse. To show messages:
Window -> Show View -> Console
Window -> Show View -> Error Log
When I renamed jurt.jar to jurt0.jar so that it cannot be found, then the following was shown in the Console pane.
Exception in thread "Thread-8" java.lang.ClassNotFoundException:
com.sun.star.comp.loader.JavaLoader
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
System.err.println also writes to the Console pane. I modified ActionOneDialog.java as follows.
public void show() {
System.err.println("show() BEGIN");
dialog.execute();
System.err.println("show() END");
}

Run java applet offline: Exception in thread "main" java.lang.NoClassDefFoundError

I just downloaded some java applets from this site: http://www.surendranath.org/Apps.html to run them offline on my laptop. Take for example this one: http://www.surendranath.org/Applets/Oscillations/Lissajous/Lissajous.html
By inspecting the source code I downloaded the file: wget http://www.surendranath.org/Applets/Oscillations/Lissajous/LissajousApplet.class
Then I tried it to run it on my ubuntu box via gappletviewer-4.8 -code LissayousApplet.class
However I got the following error message:
Exception in thfully qualifiedread "main" java.lang.NoClassDefFoundError: loaded class LissajousApplet was in fact named Applets.Oscillations.Lissajous.LissajousApplet
at java.lang.VMClassLoader.defineClass(libgcj.so.14)
at java.lang.ClassLoader.defineClass(libgcj.so.14)
at java.security.SecureClassLoader.defineClass(libgcj.so.14)
at java.net.URLClassLoader.findClass(libgcj.so.14)
at java.lang.ClassLoader.loadClass(libgcj.so.14)
at java.lang.ClassLoader.loadClass(libgcj.so.14)
at java.lang.ClassLoader.loadClass(libgcj.so.14)
at gnu.classpath.tools.appletviewer.Main.createApplet(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.StandaloneAppletWindow.<init>(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.StandaloneAppletViewer.createWindows(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.StandaloneAppletViewer.<init>(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.Main.main(libgcj-tools.so.14)
So what is the correct way to run this applet offline? Running it online within my browser and the icetea plugin works. However I need a way to run it offline.
Edit
Trying the fully qualified class-name results in:
gappletviewer-4.8 -code Applets.Oscillations.Lissajous.LissajousApplet.class -codebase codebase="../../../"
WARNING: CURRENTLY GAPPLETVIEWER RUNS WITH NOSECURITY MANAGER.
THIS MEANS THAT APPLETS YOU LOAD CAN DO ANYTHING A JAVA APPLICATION
THAT YOU DOWNLOAD AND RUN CAN DO. BE *VERY* CAREFUL WHICH APPLETS YOU RUN.
DO NOT USE GAPPLETVIEWER ON YOUR SYSTEM IF YOUR SYSTEM STORES IMPORTANTDATA.
THIS DATA CAN BE DESTROYED OR STOLEN IF YOU LOAD A MALICIOUS APPLET.
[press 'c' or 'C' to continue or anything else to quit]
c
java.lang.ClassNotFoundException: Applets.Oscillations.Lissajous.LissajousApplet not found in gnu.classpath.tools.appletviewer.AppletClassLoader{urls=[file:/home/null,file:/home/], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
at java.net.URLClassLoader.findClass(libgcj.so.14)
at gnu.classpath.tools.appletviewer.AppletClassLoader.findClass(libgcj-tools.so.14)
at java.lang.ClassLoader.loadClass(libgcj.so.14)
at java.lang.ClassLoader.loadClass(libgcj.so.14)
at gnu.classpath.tools.appletviewer.Main.createApplet(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.StandaloneAppletWindow.<init>(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.StandaloneAppletViewer.createWindows(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.StandaloneAppletViewer.<init>(libgcj-tools.so.14)
at gnu.classpath.tools.appletviewer.Main.main(libgcj-tools.so.14)
Try using the fully qualified classname
gappletviewer-4.8 -code Applets.Oscillations.Lissajous.LissajousApplet.class -codebase codebase="http://www.surendranath.org/"
Read: gappletviewer Man page

JOGL exporting to windows 8 and getting unsatisfied link error

I have been writing a game using JOGL libraries for graphics and when I have been exporting this game it has only been working on my machine. My processor is an AMD Phenom II X4 840 Processor at 3.2 GHz on Windows 7. When I export the game and run using CMD the game works fine and there are no errors.
However, when running on my friends computer I get an unsatisfied link error. His computer has a AMD A6-4400M APU and he is running Windows 8.
The error message seems to be very vague and I havn't been able to adress the problem.
Exception in thread "main" java.lang.UnsatisfiedLinkError:jogamp.opengl.windows.wgl.WGL.dispatch_wglGetProcAddress0(Ljava/lang/String;J)J
at jogamp.opengl.windows.wgl.WGL.dispatch_wglGetProcAddress0(Native Method)
at jogamp.opengl.windows.wgl.WGL.wglGetProcAddress(WGL.java:276)
at jogamp.opengl.windows.wgl.WindowsWGLDynamicLibraryBundleInfo.toolGetProcAddress(WindowsWGLDynamicLibrar yBundleInfo.java:57)
at com.jogamp.common.os.DynamicLibraryBundle.toolDynamicLookupFunction(DynamicLibraryBundle.java:341)
at com.jogamp.common.os.DynamicLibraryBundle.dynamicLookupFunction(DynamicLibraryBundle.java:369)
at com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver.resolve(GLProcAddressResolver.java:54)
at com.jogamp.gluegen.runtime.ProcAddressTable.setEntry(ProcAddressTable.java:177)
at com.jogamp.gluegen.runtime.ProcAddressTable.reset(ProcAddressTable.java:145)
at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory$1.run(WindowsWGLDrawableFactory.java:100)
at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory$1.run(WindowsWGLDrawableFactory.java:93)
at java.security.AccessController.doPrivileged(Native Method)
at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory.<init>(WindowsWGLDrawableFactory.java:93)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:171)
at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:193)
at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:213)
at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:235)
at javax.media.opengl.GLDrawableFactory.initSingletonImpl(GLDrawableFactory.java:166)
at javax.media.opengl.GLDrawableFactory.initSingleton(GLDrawableFactory.java:129)
at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1573)
at javax.media.opengl.GLProfile.access$100(GLProfile.java:76)
at javax.media.opengl.GLProfile$1.run(GLProfile.java:155)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:123)
at javax.media.opengl.GLProfile.getDefaultDevice(GLProfile.java:1837)
at javax.media.opengl.awt.GLJPanel.<init>(GLJPanel.java:337)
at javax.media.opengl.awt.GLJPanel.<init>(GLJPanel.java:291)
at javax.media.opengl.awt.GLJPanel.<init>(GLJPanel.java:282)
at main.Main.<init>(Main.java:73)
at main.Main.main(Main.java:94)
The lines in my code 73 and 94 are:
73: canvas = new GLJPanel();
94: final Main main = new Main(); //When I initialise the main class
My layout when I export it goes like this:
META-INF
Q_lib
Q.jar
run.bat (just java -jar Q.jar to run the jar file).
Inside the jar file Q.jar I have all of the .dll's for all of the types of systems.
If you need more code from my main class, I can post it up, it is too long otherwise to put up here.
Any help would be highly appreciated.
You have to follow this rule to allow GlueGen to find the native libraries when making a fat JAR, otherwise it won't know in which directories to look at them, it won't extract them, they won't be loaded and you'll get an unsatisfied link error. I advise you to post your technical questions about JOGL on its official forum in the future as only a very few JogAmp contributers and maintainers come here.
Edit.: Never put the native libraries or the JARs directly into the JVM in order to avoid conflicts when running applets and applications.

Failed to load sigar-amd64-winnt: java.lang.NullPointerException

I'm new to sigar and native library programming in java, so maybe it is just a simple problem, but I can't find a result on my own.
I'm using eclipse indigo on a win 7 (64bit) OS. I've taken the following steps:
Add sigar.jar an log4l.jar to the jre6/lib, add the sigar-amd64-winnt.dll (also the files for x86) file to ./Program Files/Java/jre6/lib.
Then I only want to create a new sigar() but get the following exception:
Failed to load sigar-amd64-winnt: java.lang.NullPointerException
org.hyperic.sigar.SigarException: Failed to load sigar-amd64-winnt: java.lang.NullPointerException
at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:170)
at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:100)
at MemExample.<clinit>(MemExample.java:8)
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.hyperic.sigar.Mem.gather(Lorg/hyperic/sigar/Sigar;)V
at org.hyperic.sigar.Mem.gather(Native Method)
at org.hyperic.sigar.Mem.fetch(Mem.java:30)
at org.hyperic.sigar.Sigar.getMem(Sigar.java:304)
at MemExample.getInformationsAboutMemor
I've already tried to manipulate the VM-Arguments (in Run Config -DJava.library.path="path/of/lib"), to set the native library in the java build path to the path of sigar/lib and to set the Systempath in the program on my own with System.setProperty("path", "-"). All of which are unsuccessful until now.
And step by step I yield to despair.
**Edit:**Is it possible that sigar only works with AMD?
Some friend tried the same code with an AMD processor and win 7 (32b) and it works.
I already look for an answer in the hyperic sigar developer forum, but I can't find any useful tips or answers.
Seems that sigar-amd64-winnt.lib is missing: http://communities.vmware.com/message/1947455#1947455

Library Error in Processing.org SimpleARToolKit & Java on Mac OSX

I am attempting to get SimpleARToolKit in the Processing.org IDE on my Mac. I have downloaded the SimpleARToolKit and JMyron files. I was getting some JMyron errors, but I moved the Library files and now those errors have gone away. The problem I am having now is when I try to run demo01.pde from the SimpleARToolKit, I get an error that says:
UnsatisfiedLinkError: no JARToolKit in java.library.path Exception in
thread "Animation Thread" java.lang.UnsatisfiedLinkError: no
JARToolKit in java.library.path at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1754) at
java.lang.Runtime.loadLibrary0(Runtime.java:823) at
java.lang.System.loadLibrary(System.java:1045) at
net.sourceforge.jartoolkit.core.JARToolKit.(JARToolKit.java:40)
at pARToolKit.SimpleARToolKit.(SimpleARToolKit.java:36) at
demo01.setup(demo01.java:44) at
processing.core.PApplet.handleDraw(PApplet.java:1608) at
processing.core.PApplet.run(PApplet.java:1530) at
java.lang.Thread.run(Thread.java:680)
The demo is crashing on this line:
ar = new SimpleARToolKit(this, capWidth, capHeight);
I have found a few other websites that seem to be asking the same question, but none of them are in English and through using Google Translate, none of them seem to resolve the issue.
Update:
This is not yet resolved but I have an update:
I found jARToolKit on SourceForge.net
Inside the jARToolKit.zip folder I found jARToolKit.jar file and copied it to my Mac/Library/Java/Extensions/ folder
Now when I run the code, the error says "no jartoolkit in java.library.path" (note the lowercase "jartoolkit") - as opposed to the original "no JARToolKit in java.library.path". If I remove the .jar file from the Extensions folder, the original error appears again, so this makes me think that I am on the right track, but still missing something.

Categories