0

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.

2
Contributors
4
Replies
6
Views
8 Years
Discussion Span
Last Post by fireballnelson
0

lol your guess is correct

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

0

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.

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.