Skip to main content

Run java class jar file together with

5 replies [Last post]
sassneto
Offline
Joined: 2010-04-29
Points: 0

Hello,

I am with the following situation:

I need to run a class in Unix AIX.

This class jRFCInterface.class receives three parameters: RFC.ini, LOG.ERR, I
I also need to carry two connectors: jodbc14.jar and sapjco.jar

The run line that I have:
java-cp / tmp/rfc/ojdbc14.jar: sapjco.jar jRFCInterface RFC.ini LOG.ERR I

I've tried several ways but always emits an error message like this:
Exception in thread "main" java.lang.NoClassDefFoundError: jRFCInterface

If inform -cp for the class, the error becomes for RFC.ini, which is not a class but a parameter.

Does anyone have an idea how I can run this?

Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sassneto
Offline
Joined: 2010-04-29
Points: 0

Hi,

I have the following in my code:

[b]/ / standard packages
import java.io. *;
import java.lang.reflect .*;
import java.sql .*;
import java.text.SimpleDateFormat;
import java.util .*;

/ / Sap packages
import com.sap.mw.jco .*;

/ / Oracle packages
import oracle.jdbc.driver .*;[/b]

my CLASSPATH like this:
[b].: / Usr/java6_64/lib/[/b]

The package sapjco.jar (com.sap.mw.jco)
is in the directory [b]/usr/java6_64/lib/[/b]

But I'm having the following message when trying to run the class:
[b]Exception in thread "main" java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO[/b]

WHAT IS MISSING??

ruivale
Offline
Joined: 2003-06-12
Points: 0

Hi,

try to add sapjco.jar to your classpath, like:

java -cp .:/Usr/java6_64/lib/sapjco.jar:*(your package where the main class is) ...

HIH

RGV

sassneto
Offline
Joined: 2010-04-29
Points: 0

Hello,

I thank those who replied.

I reached a new stage now
I need of the following files for use with Unix sapjco.jar:
[b]librfccm.so and sapjcorfc.so[/b]

Can someone provide this?

claudeabb
Offline
Joined: 2006-08-09
Points: 0

Hi,

You wrote that this application needs two librairies, but you need to add to the classpath the jar which contains the main class which seems to be jRFCInterface

you should also try to use double quote in which you declare the jars files and do not forget to separated each jar by a comma.

java -cp "/ tmp/rfc/ojdbc14.jar, / tmp/rfc/sapjco.jar, *" jRFCInterface "RFC.ini" "LOG.ERR" "I"

* represents the jar file which contains the main class jRFCInterface

Currently the error message you got means that the main class cannot be found.

Claude

sassneto
Offline
Joined: 2010-04-29
Points: 0

Hi Claude

You mean I need to change the Class-Path in manifest?
The commas, I am working in a Unix environment, I think need exchange them for a colon (:).