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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:59:41+00:00 2026-05-23T00:59:41+00:00

package com.test01; public class test01 { public static void main(String[] args) { System.out.println(hi); }

  • 0
package com.test01;

public class test01 {
    public static void main(String[] args)
    {
        System.out.println("hi");
    }
}

I think the java application launcher is very stupid.
I have point out the test01.class position:
java -cp . test01(.class)
but this doesn’t works. It’s very hard to use.

  • 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-23T00:59:42+00:00Added an answer on May 23, 2026 at 12:59 am

    You would run

    java com.test01.test01
    

    but having a class with the same name as a package is a really bad idea (as well as not following the Java naming conventions).

    You’d need to run it with the relevant class on the classpath. For example, you could just compile it like this (from the “root” of your source tree):

    javac -d . [path to source file]
    java com.test01.test01
    

    or if you’ve got your source organized appropriately already:

    javac com\test01\test01.java
    java com.test01.test01
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please consider the following java source: package com.stackoverflow; public class CondSpeed { private static
I've got following java class. package com.org.data.dbresource; import org.springframework.orm.ibatis.SqlMapClientTemplate; public class DBConnectionManager { private
package com.example.helloandroid; import java.io.File; import android.os.AsyncTask; import android.os.Environment; import android.widget.Toast; public class CheckTask extends
package com.test; public class OuterClass { public class InnerClass { public class InnerInnerClass {
SampleBean: package com.springexample; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; public class SampleBean { private BeanTypeOne beanOne;
My custom type is (no default constructor!): package com.XXX.common; public class Email implements Serializable
package com.em.progressb; public class progressb extends Activity implements OnClickListener { ProgressDialog dialog; int increment;
Is there a Java package providing funcionality like the .Net System.Data namespace ? Specificaly
package com.services { import com.asfusion.mate.events.ResponseEvent; import com.events.navigation.DesgManagementEvent import flash.events.EventDispatcher; import mx.controls.Alert; public class UserManager
package com.adam.etutorial { import flash.display.MovieClip; import flash.text.TextField; import flash.display.Sprite; import flash.text.TextFormat; import flash.display.Shape; public

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.