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

The Archive Base Latest Questions

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

So I want to mess around with a library I just downloaded called stdlib.jar

  • 0

So I want to mess around with a library I just downloaded called stdlib.jar (downloaded from http://introcs.cs.princeton.edu/java/stdlib/)

So I added the library to the project, and when I inspect the project it looks like this in netbeans:
package inspector in netbeans

So it seems that the library is set up properly.

But then in my project when I try to use one of the library classes, it looks like this.

My Custom Audio Player Class

Mousing over the import statement at the top, says expected "."
And If I change the import statement to say import stlib.StdAudio it says that the library does not exist.

Any body know what the problem is?

  • 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:15:48+00:00Added an answer on May 26, 2026 at 1:15 am

    All the source code of this library (which is pretty unusual: first time I encountered this) is in the default package, which means you don’t have to import anything if your class is also in the default package. Just use the class name.

    StdAudio.play(tone);
    

    Just make sure it is in the classpath, but I think it is if I look at your screenshot from NetBeans.


    Update: It seems like I’m wrong. At the bottom of the page, you can find this:

    Q. If I use a named package to structure my code, the compiler can no
    longer access the libraries in stdlib.jar. Why not?
    A. The libraries
    in stdlib.jar are in the “default” package. In Java, you can’t access
    classes in the default package from a named package.
    If you need to
    use our standard libraries with a named package, you must put our
    libraries in a package, as in this solution.

    So, you have to copy the classes into your project its package musicplayer.

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

Sidebar

Related Questions

I am trying to mess around with rendering things in 3d. I want to
I want to mess around with realtime information, and there is a pretty standard
I'm relatively new to Java and decided to mess around a bit with Swing.
Want to send the text from my current vb application to the Active Window
want to fetch the value from dynamically created textfield with tag from NSMutableArray.... Txt_New_Estimated
Want to develop a query refinement tool just like Google Suggest so that i
I've been playing around with upgrading from an iPhone app to a Universal application,
I'm trying to create a script to mess around with the db entries in
I'm very new to Silverlight. I've downloaded VS 2010 so that I can mess
So I have started to mess around with XNA today and I am still

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.