Java Exception has occurred when opening .JAR file - java

I am trying to run a jar file that came with a program designed by BOSCH called EsiTronic. I receive the following error message "A java exception has occurred" I made some research and looked in the other threds of this forum but it did not help me. My gues is that the version I am using is not supporting the version the program was compiled on. I tried running it from CMD to see the detailed error message. If someone can tell me more from this message I will apreciate. I want to point out I am not a programer so my knoledge is limited here.
Thanks!
Exception in thread "main" java.lang.ClassFormatError: Truncated class file

Exception in thread "main" java.lang.ClassFormatError: Truncated class file
Theres nothing much that you can do here except re-download the jar file. The jar file probably got curropted during download or even at the time of packaging from the source

Related

Exception Error in creating an instance of RandomDataImpl

I am getting this exception error at
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/math3/random/RandomDataImpl
at this line of code:
randomData_ = new RandomDataImpl();
and this is how the class is imported in the code :
import org.apache.commons.math3.random.RandomDataImpl;
i have added all of the math common classes to the classpath while running the code. any ideas whats going on ?
It looks like you did not set the appropriate classpath.
You can set it as follows:
java -classpath lib/*.jar:. mypackage.MyClass
Try that and I am sure it will work.
If you are using maven, then read this article
You can also check your current classpath with:
System.getProperty("java.class.path")
Just write simple app printing this property out and run it just as you run an app with which you are having problems.

java.lang.UnsatisfiedLinkError: no so in java.library.path

When i'm trying to load the .so file from the Java, i'm getting error like this.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no yeslib.so in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at com.rct.micros.util.GetCustClass.getScratchCode(GetCustClass.java:76)
at com.rct.micros.util.GetCustClass.main(GetCustClass.java:39)
I have tried System.load(absoulte path) and System.loadLibrary(sofilename). Both are giving the same error. When i copy this so file into usr/lib/jvm package, it is working..
can anyone help how to get this solved using Java. i'm running on linux box.
It's possible that the library is on your path, but it can't be loaded for some other reason.
A trick I've used to debug problems like this is to run java -Xrunsofilename
-Xrun is the JVM option to load JVMPI libraries (the old profiling interface). If it succeeds, it will load the library and complain that it's not an agent library. But if it fails (hopefully!) it will print an error message. This is usually a more descriptive error message than what you get from the UnsatisfiedLinkError.

ZMQ - libzmq.so.3: cannot open shared object file: No such file or directory

I'm trying to embed zeroMQ in my app, I followed this guideline to install ZMQ, so till here everything works fine.
I have this line of code in my app:
ZMQ.Context m_context = ZMQ.context(1);
but above line of code raise below exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/libjzmq-812339378390536247.lib: libzmq.so.3: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at org.zeromq.EmbeddedLibraryTools.loadEmbeddedLibrary(EmbeddedLibraryTools.java:136)
at org.zeromq.EmbeddedLibraryTools.<clinit>(EmbeddedLibraryTools.java:22)
at org.zeromq.ZMQ.<clinit>(ZMQ.java:38)
at com.castaclip.verticals.Messenger.<init>(Messenger.java:125)
at com.castaclip.verticals.PushMessenger.<init>(PushMessenger.java:30)
at com.castaclip.verticals.pushserver.App.setup(App.java:60)
at com.castaclip.verticals.pushserver.App.main(App.java:41)
The error is exactly pointing to this line.
P.S: its a little bit difficult to fully explain this question.. if you have any question plz let me know. thanks.
If you've successfully built libzmq and jzmq in that order, I would run:
$ sudo ldconfig
to update the system library cache. Then I would check to see if LD_LIBRARY_PATH is defined like Raffian mentioned, or set your library path explicitly to something like:
$ java -Djava.library.path=/usr/lib:/usr/local/lib
Finally I tried to figure out the problem.
I was using zeromq-2.1.10 and this was part of the problem.
So I installed zeromq-3.2.3 from the source and problem resolved.
I encountered a mystifying instance of this message when I:
# java -Djava.library.path=/usr/hf/zmq/lib/ -cp '/usr/hf/lib/*:.' com.zmqtest.MA
Exception in thread "main"
java.lang.UnsatisfiedLinkError: /usr/hf/zmq/lib/libjzmq.so:
libzmq.so.3: cannot open shared object file: No such file or directory
which was fixed with a solution that makes no sense at all to me:
# LD_LIBRARY_PATH=/usr/hf/zmq/lib/ java -Djava.library.path=/usr/hf/zmq/lib/ -cp '/usr/hf/lib/*:.' com.zmqtest.MA
wierd.

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.

java.lang.NoSuchMethodError: java.lang.NoSuchMethodError

Running Tomcat 7 through eclipse
The error reported is:
javax.servlet.ServletException: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/IProblem;
at org.apache.jasper.compiler.JDTCompiler$2.acceptResult(JDTCompiler.java:341)
I have tried both jasper-jdt-6.0.13.jar and tomcat-6.0.16-jasper-jdt.jar and both report the same error. In a way I shouldn't be surprised because I ran:
jar tf tomcat-6.0.16-jasper-jdt.jar
and it doesn't have the class org.eclipse.jdt.internal.compiler.CompilationResult in it. But this site http://www.java2s.com/Code/Jar/STUVWXYZ/Downloadtomcat6016jasperjdtjar.htm says it does!!
Can someone tell me what the correct jar file is and where to get it from?
It seems to be a recurring theme. http://www.findjar.com lists a number of jars that purport to have this class - but do not.
OK, Found it in jasper-compiler-jdt-5.5.23.jar
Found it in jasper-compiler-jdt-5.5.23.jar

Categories