Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JNI on Linux----error

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i'm trying to run a simple jni program on linux platform.
it works till header file creation. the native code i write doesn't compile saying

/usr/lib/crt1.o: In function '_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to 'main'
collect2: ld returned 1 exit status
can any one help me get rid of this error.
there is some error with java communicating with linux core libraries may be my code is not finding where to send output or where to take input from...........
what may be the possible error and its cure.
thanx
harish
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi harish ,
I would be interested to know whether you were able to run a simple jni program on linux platform.
If so what was the problem for it to not run previously .
thanks,
Niranjan
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I encountered a similar problem before.Please check in the command prompt $which javac
$which java
If it gives you a path in /usr/lib....then you need to check the class path,java home and path that you have set.When you are setting the classpath,use JAVA_HOME=/home/.....Similarly for CLASSPATH and PATH variables.Do not forget the "/" before the path start.
Hope this helps you solve the problem.Good luck.

Originally posted by Harish Kashyap:
hi all,
i'm trying to run a simple jni program on linux platform.
it works till header file creation. the native code i write doesn't compile saying

/usr/lib/crt1.o: In function '_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to 'main'
collect2: ld returned 1 exit status
can any one help me get rid of this error.
there is some error with java communicating with linux core libraries may be my code is not finding where to send output or where to take input from...........
what may be the possible error and its cure.
thanx
harish


 
I'm so happy! And I wish to make this tiny ad happy too:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic