jni 잘 아시는분.. JNI_CreateJavaVM 에러입니다.

조야의 이미지

int main()
{
int i;
long re;
JavaVMOption options[2];
JavaVM *jvm;
JNIEnv *env;
JavaVMInitArgs vm_args;
options[0].optionString=".";
options[1].optionString="-Djava.compiler=NONE";
vm_args.version = JNI_VERSION_1_4;
vm_args.options = options;
vm_args.nOptions =2;
vm_args.ignoreUnrecognized = JNI_FALSE;
re = JNI_CreateJavaVM (&jvm, (void **)&env,&vm_args);
if(re == JNI_ERR ) {
printf("Error invoking the JVM");
exit (-1);
}

sleep(10);
(*jvm)->DestroyJavaVM(jvm);
scanf("%d",&i);
return 0;
}

컴파일 옵션은

gcc -g test.c -o test -L /usr/java/j2sdk1.4.2_15/jre/lib/i386/server/ -ljvm

인데.. JNI_CreateJavaVM 실행이 되지 않고..

에러가 납니다 ㅠ_ㅠ..

도와주세요 ㅠ_ㅠ

익명 사용자의 이미지

에러 메시지를 봐야 도움을 줄 수 있을거 같은데요...

조야의 이미지

Unrecognized option: .
Error invoking the JVM

JVM Create 함수 생성시 에러 입니다 ㅠ_ㅠ..

zenit의 이미지

전 해보질 않아서 ^^

options[0].optionString=".";
부분에서 알수없는 옵션이라고 하는데요
왠지 저부분 잘못된거 같네요

조야의 이미지

구글은 위대했습니다 ㅡ.,ㅡ;

그러나.. 에러를 수정 하고 나니..

Error occurred during initialization of VM
Unable to load native library: libverify.so: cannot open shared object file: No such file or directory

이런 에러가 ㅡㅡ;;..

또다시 구글의 세계로 들어 가봐야겠습니다

익명 사용자의 이미지

혹시 위에

invocationApi.c:(.text+0x3d): undefined reference to `JNI_CreateJavaVM'
collect2: error: ld returned 1 exit status

이 오류는 어떻게 해결 하셨나요? 아무리 찾아도 안되고 Path를 변경해도 안되네요..

익명 사용자의 이미지

LD_LIBRARY_PATH 환경변수에 생성한 Native코드 .so파일이 있는 path를 추가시켜줘보세요..

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.