cancel
Showing results for 
Search instead for 
Did you mean: 

sap and java interface problem

Former Member
0 Kudos

hi,

iam writing a program for iteracting sap and java system.

i write a pgm in java to interact sap , in notepad, when i am trying to execute the program it is showing this error.

C:\>javac firstEx.java

error: cannot read: firstEx.java

1 error

This is my program. pls any one help me.

import com.sap.mw.jco.*;

public class firstEx {

static myFirstServer serverConnections[] = new myFirstServer[3];

public static void startServers() {

JCO.addClientPool("POOL", 3, "800", "sridevi" ,"rvst2009" , "EN",

"5.137.151.198" ,"00");

IRepository repository = JCO.createRepository("REP", "POOL");

for(int i = 0; i < serverConnections.length; i++) {

serverConnections = new myFirstServer

("5.137.151.198", //gateway host, often the same as host

"sapgw00", //gateway service, generally sapgw+<SYSNR>

"JCOSERVER01", // corresponds to program ID defined in SM59

repository);

serverConnections.start();

};

}

public static void stopServers() {

for(int i = 0; i < serverConnections.length; i++)

{

serverConnections.stop();

};

}

public static void main(String[] args) {

startServers() ;

}

}

Accepted Solutions (0)

Answers (2)

Answers (2)

ravindra_bollapalli2
Active Contributor
0 Kudos

hi,

if u r using notepad the default will be saved with *.ext

if so do like this "firstEx.java" and save as u r common folder

and make sure that u added the classpath to the in evniroment variables so that java and javac will be excecuted

let me know u need any further info

bvr

Former Member
0 Kudos

Hi

yes iam giving like this "firstEx.java" while in saving the file.

It also exists in C: folder

ravindra_bollapalli2
Active Contributor
0 Kudos

hi,

if so check the classpath

for example

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

http://java.sun.com/docs/books/tutorial/essential/environment/paths.html

in the above link u have to write applications in bin folder

when u r writing in u r personal folder

http://mindprod.com/jgloss/classpath.html

let me know u need any further info

bvr

Former Member
0 Kudos

Hi bvr,

i write a small java program and execute in commandprompt , iam getting the output.

i think my classpath is not a problem.

when iam executing that file "first.Ex.java"

it is showing error it cannot read.

Thanks

ravindra_bollapalli2
Active Contributor
0 Kudos

hi sridevigunda,

if classpath is not a problem

try like this

javac c:\fristEx.java ( javac and complete location of the java file )

bvr

Former Member
0 Kudos

Hi,

Make sure that the "firstEx.java" exists in C:\

Regards

Ayyapparaj