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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:59:07+00:00 2026-06-07T09:59:07+00:00

I have a simple program written in Java: package edu.oakland.lecture; public class Alfa {

  • 0

I have a simple program written in Java:

package edu.oakland.lecture;

public class Alfa {

    int a;

    public int getAttribute() {
        System.out.println("returning value of a");
        return a;
    }

    public static void main(String []args) {
        Alfa alfa = new Alfa();
        int number = alfa.getAttribute();
        System.out.println(number);
    }
}

It compiles with javac on both windows (xp) and os x (lion), but it only runs on windows.

This is the command I use to compile the program:

javac -d bin source/edu/oakland/lecture/Alfa.java

This is the command I use to execute it:

java -classpath bin; edu.oakland.lecture.Alfa (I also tried -cp instead of -classpath in Terminal)

As I mentioned, I get the expected output on windows side, but I get this message on the os x side:

-bash: edu.oakland.lecture.Alfa: command not found

I know it has to be something stupid simple; what am I overlooking?

Thanks!

  • 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-07T09:59:09+00:00Added an answer on June 7, 2026 at 9:59 am

    The classpath separator on UNIX-like systems (such as OS X) is ‘:’, not ‘;’. Your command should just be

    java -classpath bin edu.oakland.lecture.Alfa
    

    If you actually did have several different components to your classpath, it would look like:

    java -classpath bin:foo edu.oakland.lecture.Alfa
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a simple package program: //A simple package package MyPack class Balance
I have a simple program (written in Java) which uses the google protocol buffer
I have written a Java program which I package and run from a JAR
I have written a simple network program on java using sockets. Program has a
I have written a simple network program on java using sockets. Program has a
I am very new to JAVA. I have written simple program (in Linux -VIM
I have written simple j2me program with LWUIT package.I have added one Form in
I have written a simple OpenGL program in C++ that displays a line joining
Well, i have written a simple python program that parses HTML with HTMLParser. Here
I have written a simple C++ shell program to parse large XML files 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.