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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:14:54+00:00 2026-05-26T01:14:54+00:00

I have the following package structure where im trying to run a sample hibernate

  • 0

I have the following package structure where im trying to run a sample hibernate app

Source files: /home/chander/workspace/HibernateApp/src/com/hib/TranslateSQL.java

My current directory:

/home/chander/workspace/HibernateApp/src

Compile:
$JAVA_HOME/bin/javac com/hib/*.java — This ran successfully

Run:
$JAVA_HOME/bin/java com/hib/TranslateSQL Giving the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: TranslateSQL (wrong name: com/hib/TranslateSQL)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:315)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: TranslateSQL.  Program will exit.

I have my classpath and JAVA_HOME set. I dont seem to find what is wrong with my command.

Also tried the following command:

$JAVA_HOME/bin/java com.hib.TranslateSQL

Got the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/hib/TranslateSQL
Caused by: java.lang.ClassNotFoundException: com.hib.TranslateSQL
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:315)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: com.hib.TranslateSQL.  Program will exit.
  • 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-26T01:14:55+00:00Added an answer on May 26, 2026 at 1:14 am

    I got it to work by doing this:

    cd  /home/chander/workspace/HibernateApp/src/com/hib/
    
    export CLASSPATH=$CLASSPATH:/home/chander/workspace/HibernateApp/src/
    
    $JAVA_HOME/bin/java com.hib.TranslateSQL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following package on Eclipse: com.mortgageapp.projects.app I'm not interested about the package
I apologize for yet another __init__.py question. I have the following package structure: +contrib
Following structure: app.py /package __init__.py foo.py bar.py foo.py and bar.py contains both classes Foo
I have following package structure and classes. package X Class A private string fieldX;
I have following directory structure: / package/ subpackage/ __init__.py file.py __init__.py file.py main.py /package/subpackage/__init__.py
Say I have the following structure: package require Itcl itcl::class AAA { private variable
I have following Code package cyclist.project; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException;
Suppose I have following code package memoryleak; public class MemoryLeak { public static int
In Scala IDE I have the following code: package pkg.one object S { class
I am using Ubuntu 9.04 I have installed the following package versions: unixodbc and

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.