QUESTION POSED ON: 10 November 2003 I have a problem with JCo and JAR:
When I compile my code and execute the main batchscan.class by typing "java batchscan" the program works perfectly.
But when I try to create a sap.jar file, by including my manifest file, all class files and my sapjco.jar file, it does produce the jar file. However, I cannot execute the jar file. It executes the program up to a point and then I get the run-time error: "Exception in thread "main"
java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO
at batchscan.<init>(batchscan.java:38)
at batchscan.main(batchscan.java:362)"
My classpath is already set corrcetly.
>
Depending on the type of Java archive you are creating, you will need to organize the directory structure in a specific manner. One of the most common Java archive type is the WAR file, or Web Application Archive. The WAR file contains a specific directory structure that allows you to easily access other stored archives (i.e. sapjco.jar). In order to access any Java jar, the WAR structure must have this path: /WEB-INF/lib with the lib directory containing sapjco.jar. Any jar files in this directory can be automatically used by another class in the Web application without having to worry about the CLASSPATH setting.
Search and Browse the Expert Answer Center Search and browse more than 25,000 question and
answer pairs from more than 250 TechTarget industry experts.
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.
All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy SearchSAP.com is a search service provided by TechTarget and is completely independent of and not affiliated with SAP AG.