I am having a problem with this code:

import javax.sound.*;

public class Sound {
    public static void main(String[] args) {
        //Code Body
    }
}

The problem has nothing to do with code itself; the compiler returns this message when i try to compile:

Sound.java:1: package javax.sound does not exist
import javax.sound.*;
^

I am guessing that the Sound package didn't get installed somehow but that seems to simple (ha ha). Thanks for the help.

lol your guess is correct

either its not installed, or you need to add it as a reference or classpath or whatnot

How do you install it, or add it as a reference or classpath? I have looked throughout the java directory for a clue but I can't find anything.

What a stupid mistake!!

The following code does not work:

import javax.sound.*;

public class Sound {
    public static void main(String[] args) {
        //Code Body
    }
}

While this code does:

import javax.sound.sampled.*;

public class Sound {
    public static void main(String[] args) {
        //Code Body
    }
}

So obviously javax.sound isn't recognized as a package while sampled and midi are. Thanks for being patient.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.