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 7791919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:02:59+00:00 2026-06-01T22:02:59+00:00

I wrote a small java program in Netbeans. It compiles and runs perfectly. But

  • 0

I wrote a small java program in Netbeans. It compiles and runs perfectly. But I also need to compile it in javac in Linux because this homework is tested there. Whenever I attempt, I get the following compile error message. Do you have any idea about this message?

/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64/crt1.o: In function `_start':
/home/abuild/rpmbuild/BUILD/glibc-2.14.1/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'

I just write the following line for import a library

 import java.sql.*;

I am just using println except sql operations. The beginning of my code is below:

Connection conn = null;
try{
    String username = ".....";
    String password = "....";
    String url = "jdbc:mysql://localhost:3306/.....";
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    conn = DriverManager.getConnection(url, username, password);
    System.out.println("Database connection extablished.");
}
catch(Exception e){
    System.out.println("Cannot connect to database server");
}

After this part of code, nothing special, just ordinary lines.

  • 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-06-01T22:03:00+00:00Added an answer on June 1, 2026 at 10:03 pm

    It seems that error may be because you’re not defining a main method, and the compiler therefore can’t find it.

    However, I have to ask why you’re using GCC? Normal JDK is available on Linux and should be your preferred choice unless you have a very good reason otherwise! If Netbeans isn’t compiling your application on Linux then it’s probably because you haven’t set something up properly or installed the JDK – you can (and should) use the JDK rather than GCJ, which is now largely unmaintained.

    You can either grab it through your package manager or download it separately here.

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

Sidebar

Related Questions

I wrote a small java application and also wrote a small linux script to
I wrote a small email sending program in java, it has from , to
I wrote some small apps using .NET 3.5 but now I am stuck with
I wrote a small program, that creates files at an interval of 1 minute.
I wrote a small program to test accessing a widget parent's slot. Basically, it
I wrote this small C++ program and built it(Release) #include<iostream> int main(){ std::cout<<Hello World;
I wrote a small application on Redhat Linux 6 using g++ 4.4.6. After compilation,
I recently inherited a small Java program that takes information from a large database,
I wrote a small program in C# NET a while back to keep a
I'm having an issue with a small program that I wrote. It does what

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.