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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:07:38+00:00 2026-05-23T07:07:38+00:00

I installed the J2SE 6.o version. Now I’m having a problem getting it to

  • 0

I installed the J2SE 6.o version. Now I’m having a problem getting it to work right.

> C:\java\jdk1.6.0_25\bin

This is the path of the bin file, and I put this in the Path tab. In the environment settings.

What are the next steps that I have to take to run .java files from the command prompt?

Do I have to put something in the class-path tab too?

Let me elaborate my problem:

If I run and compile the below mentioned file called Shirt.java it works fine.

public class Shirt{
public int ShirtID=0;
public String description="-description required-";
public char colorCode='U';
public double price=0.0;
public int quantityInStock=0;


public void displayShirtInformation(){
    System.out.println("ShirtId:"+ShirtID);
        System.out.println("ShirtDescription"+description);
        System.out.println("Color Code:"+colorCode);
        System.out.println("Shirt Price"+price);
        System.out.println("Quantity In Stock"+quantityInStock);
    }
}

But if I run another file that calls the previous file, then problems crop up.
The file that calls the previous file is as follows.

public class ShirtTest {

  public static void main (String args[]) {

  Shirt myShirt = new Shirt();

  myShirt.displayShirtInformation();

  } 
}

When I try to execute the second file, there are a few errors that crop up and no compilation takes place. I believe it has something to do with some problem with the environment variable Path declaration.

  • 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-23T07:07:38+00:00Added an answer on May 23, 2026 at 7:07 am

    It is better to make sure that you do not have a CLASSPATH environment variable set. If it is not set, Java will by default look in the current directory for class files. As long as your Java source files are in the same directory (and not in a package) you should be able to compile and run them with simple commands:

    javac Shirt.java
    javac ShirtTest.java
    java ShirtTest
    

    If this complains with a NoClassDefFoundError, then try specifying the classpath on the command line using the -cp option:

    javac -cp . Shirt.java
    javac -cp . ShirtTest.java
    java -cp . ShirtTest
    

    (note that . means “the current directory”).

    See the Getting Started tutorial, which also has a section on common problems and their solutions.

    When you get an error, please always copy & paste the exact error message, instead of just saying “I get some errors”. The more specific information you give, the easier it is to understand what the exact problem it is and the better we can help you.

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

Sidebar

Related Questions

I have installed jdk1.6.0_21 and sqldeveloper(using alien) on debian(lenny). Now when I run sqldeveloper
I installed opensolaris I saw that it has /usr/jdk/jdk1.6 however it had no bin/javac
From someone's project, I am getting this error: Java Build Path Problems (1 item)
I installed WSS Infrastructure Update and MOSS Infrastructure Update ( http://technet.microsoft.com/en-us/office/sharepointserver/bb735839.aspx ) and now
I installed ActiveReports from their site. The version was labeled as .NET 2.0 build
I installed the ReSharper evaluation version and uninstalled it. Afterwards Visual Studio's Intellisense stopped
Installed Visual Studio Web Developer 2010 Express from the ISO available from this page:
I installed Perforce plugin version 3.4 on Eclipse Ganymede, configured my connection and workspace.
Installed SlikSvn on Window 2008 server Created Repository at c:\dia\svn\repos running this windows service
I installed m2eclipse to build a java project in Eclipse. I imported the project

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.