Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6809169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:03:13+00:00 2026-05-26T20:03:13+00:00

I am writing a Java program on Suse Linux 11 using JavaSE-1.6 and I

  • 0

I am writing a Java program on Suse Linux 11 using JavaSE-1.6 and I am having a problem building using javac.

I am following the tutorial on

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html

and have so far written the following:

package com.ctest;

class CTest
{
    // Native method declaration
    native int testCall();

    // Load the library
    static
    {
        System.loadLibrary("fpdpReaderLib");
    }

    public static void main(String args[])
    {
        int retVal;

        // Create class instance
        CTest cLangTest = new CTest();

        // Call native method
        retVal = cLangTest.testCall();

        System.out.println(retVal);
    }
}

When I run javac CTest.java i get an error:

/usr/lib/gcc/i586-suse-linux/4.3/../../../crt1.o: in function '_start':
/usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference to 'main'
/tmp/cc97kcJu.o:(.data+0x28) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()'
/tmp/cc97kcJu.o:(.data+0x74) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()'
collect2: ld returned 1 exit status

I am suspecting it is using gcc rather than the java version of javac but I’m not sure.

Any ideas what the problem could be?

I have tried using the “–main=” option mentioned here:

http://gcc.gnu.org/java/faq.html#4_1

but instead of the error before I now just get:

/tmp/ccwfugWq.o:(.data+0x28) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()'
/tmp/ccwfugWq.o:(.data+0x74) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()'
collect2: ld returned 1 exit status
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:03:14+00:00Added an answer on May 26, 2026 at 8:03 pm

    I think you should install and use the Sun Java SDK rather than using the gcc javac compiler.

    Google for suse javac gcc throws up loads of similar problems and the solution always seems to be to use the Sun JDK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried writing a program in Java using regex to match a pattern and
I am interested in writing a Java program which does the following. Attach to
I'm writing a little Java program (it's an ImageJ plugin, but the problem is
I'm writing (under linux or windows+cygwin) a java program that needs to run a
I am writing a Java Swing-based program using and JFrame that is able to
I am writing a java program to process direct payments using paypal. Naturally I
I am writing a simple start-up java program. The problem I am facing is
I'm writing a java program running at Linux. Below is the java method createHinted3gpFile
I am writing a java program that needs a file open dialog. The file
I am writing this java program to find all the prime numbers up to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.