(Bundled) cc: "jni_md.h", line 22: warning 5: "signed" will become a keywor
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ram_Maddela
Posted On:   Thursday, July 28, 2005 10:54 AM

Hi i have written this following java file and compiled and copied the class file in to my local folder and set the path & every thing properly.. and i have written c code which can invoke the method send() from ...is given below.. while compiling the C code..i am getting lot many errors..like (Bundled) cc: "jni_md.h", line 22: warning 5: "signed" will become a keyword. (Bundled) cc: "jni_md.h", line 22: error 1000: Unexpected symbol: "char". (Bundled) cc: "jni.h", line 104: error 1000: Unexpected symbol: "jbyte". (Bundled) cc: "jni.h", line 104: error 1573: Type of "b" is undefined due to an illegal   More>>

Hi

i have written this following java file and compiled and copied the class file in to my local folder and set the path & every thing properly..

and i have written c code which can invoke the method send() from ...is given below..

while compiling the C code..i am getting lot many errors..like

(Bundled) cc: "jni_md.h", line 22: warning 5: "signed" will become a keyword.
(Bundled) cc: "jni_md.h", line 22: error 1000: Unexpected symbol: "char".
(Bundled) cc: "jni.h", line 104: error 1000: Unexpected symbol: "jbyte".
(Bundled) cc: "jni.h", line 104: error 1573: Type of "b" is undefined due to an
illegal declaration.
(Bundled) cc: "jni.h", line 104: error 1578: Size of struct or union member is u
nknown.
(Bundled) cc: "jni.h", line 170: warning 5: "const" will become a keyword.
(Bundled) cc: "jni.h", line 170: error 1000: Unexpected symbol: "struct".
(Bundled) cc: "jni.h", line 184: warning 5: "const" will become a keyword.
(Bundled) cc: "jni.h", line 184: error 1000: Unexpected symbol: "struct".

like this i am gettting many errors....Pls explain what might be the problem...how to fix this problem...
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

public class SendApp {
public void send()
{
String subject = "HI";
String content = "hi how are you this is ram";
String from = "mramkumar.maddela@rediffmail.com";
String to = ""mramkumar.maddela@rediffmail.com";";

try{
// Create a mail session
java.util.Properties props = new java.util.Properties();
props.put("mail.smtp.host", "intpm202.apac.corp.eds.com");
//props.put("mail.smtp.host", smtpHost);
//props.put("mail.smtp.port", ""+smtpPort);
Session session = Session.getDefaultInstance(props, null);
// Construct the message
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
msg.setSubject(subject);
msg.setText(content);
// Send the message
Transport.send(msg);
}
catch(Exception e)
{
System.out.println(e.toString());
}
}// End of Send method

} //End of Class Description



#include
#include "jni.h"

void main(int argc, char *argv[])
{
JavaVM *jvm;
JNIEnv *env;
JDK1_1InitArgs vm_args;
int verbose = 1;
printf("Hello, world
");
jclass cls;
jmethodID mid;
jthrowable jthr;
/* Setup the environment */
JNI_GetDefaultJavaVMInitArgs ( &vm_args );
vm_args.classpath = "/home/ed852603/Ram:.";
JNI_CreateJavaVM(&jvm, &env, &vm_args );
/* Find the class we want to load */
cls = (*env)->FindClass( env, "SendApp" );
if ( verbose ) printf ( "Class: %x" , cls );

/* Find the method we want to use */
mid = (*env)->GetMethodID( env, cls, "send", "(I)I" );
if ( verbose ) printf ( "Method: %x" , mid );
printf("second call to Java returns:%d
", (*env)->CallVoidMethod(env, cls, mid) );

}

pls explain how to fix this problem..pls write to me

Ram.K.Maddela
ramm@inbox.com
93827 39948(india)

   <<Less
About | Sitemap | Contact