I have a jar file without its main class specified in manifest. So i followed an answer given here:
How to run a class from Jar which is not the Main-Class in its Manifest file
It seems to try to run main from this class. However it looks like importing some other class from this jar file is broken for some reason.
Here is the minimized version of my problem:
jar tf test.jar
gives:
META-INF/
META-INF/MANIFEST.MF
ClassIWantToRun.class
something/
something/something/
something/something/something/ClassA.class
Sources of ClassIWantToRun.class viewed with jd-gui seems to be:
import something.something.something.ClassA;
public class ClassIWantToRun
{
public static void main(String[] args)
{
int x = ClassA.comeMethod();
}
}
Running this with:
java -cp test.jar ClassIWantToRun
gives me the exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/OS4690/FlexosException
at ClassIWantToRun.main(ClassIWantToRun.java:7)
Caused by: java.lang.ClassNotFoundException: com.ibm.OS4690.FlexosException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 1 more
I know only basics of Java but it seems that ClassA can not be found even with the line: import something.something.something.ClassA How can i make this run?