Results 1 to 6 of 6
  1. #1
    ankiit is offline Member
    Join Date
    Dec 2011
    Location
    India
    Posts
    74
    Rep Power
    0

    Default How do I go on importing JSAPI classes into my code?

    I am using ubuntu 12.04.

    I am planning to work on Java speech recognition (Start-up Project). While I was trying to import classes like javax.speech.*, javax.speech.recognition.* the system gave me an error saying that the classes are not found.

    I have tried freeTTS, but having a hard-time importing the classes. Does anybody have any ideas?

    Thanks

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,842
    Rep Power
    19

    Default Re: How do I go on importing JSAPI classes into my code?

    Have you got the jar file that contains those classes on your class path?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    ankiit is offline Member
    Join Date
    Dec 2011
    Location
    India
    Posts
    74
    Rep Power
    0

    Default Re: How do I go on importing JSAPI classes into my code?

    Please correct me if I am wrong, do i need to add the path of jar file to the path which contains reference to bin directory under environment variables.

    i have added the jsapi.jar to the class path referring to jdk's bin dir.
    Last edited by ankiit; 08-29-2012 at 02:56 PM.

  4. #4
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,842
    Rep Power
    19

    Default Re: How do I go on importing JSAPI classes into my code?

    No, you add it to the specific classpath used for compiling or executing (ie javac or java).
    If you are using an IDE then you add it to the build path or equivalent, which is IDE dependent and will be in the docs for it.
    It all depends how you are doing this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    ankiit is offline Member
    Join Date
    Dec 2011
    Location
    India
    Posts
    74
    Rep Power
    0

    Default Re: How do I go on importing JSAPI classes into my code?

    so does this mean that i copy that jar file and place it in a directory containing javac? Please excuse for my novice questions.

  6. #6
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,842
    Rep Power
    19

    Default Re: How do I go on importing JSAPI classes into my code?

    Classpath.
    You want to use the -classpath switch, not the CLASSPATH environment variable.
    That's if you;re using the command line.
    If you're using an IDE (not recommended if you're only just starting out) then you'll need to read up on how the classpath (or build path) works for that IDE.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. importing classes
    By javajames in forum New To Java
    Replies: 6
    Last Post: 05-24-2011, 09:21 AM
  2. Dynamically interpreting/importing code/classes
    By ~ in forum Advanced Java
    Replies: 1
    Last Post: 04-27-2011, 04:06 AM
  3. importing other classes or using a Jar
    By xhane in forum New To Java
    Replies: 3
    Last Post: 01-31-2009, 05:20 AM
  4. Need help with importing classes
    By Deathmonger in forum New To Java
    Replies: 3
    Last Post: 02-07-2008, 10:03 AM
  5. Importing classes
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-06-2007, 02:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •