Results 1 to 10 of 10
  1. #1
    Boreeas's Avatar
    Boreeas is offline Member
    Join Date
    Apr 2011
    Posts
    20
    Rep Power
    0

    Default Importing a web library

    Hey,
    I am trying to write an IRC Bot that automatically translates Portuguese to English.

    However, importing the library gives me the following error:
    Java Code:
    package com.google.api.translate.* does not exist
    Code:
    Java Code:
    import com.google.api.translate.*;
    This is the code that uses the library:
    Java Code:
    if (line.contains("TFM") && (line.contains("br") || line.contains("BR"))) {
    
                    Translate.setHttpReferrer(server);
    
                    String translatedText = Translate.execute(line.substring(lastIndexOf("]") + 1), Language.PORTUGUESE, Language.ENGLISH);
    
                    writer.write(toChan + translatedText + "\r\n");
    
                }
    I have never worked with web libraries and therefore don't know how to use them.
    Thanks for your help!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  3. #3
    Boreeas's Avatar
    Boreeas is offline Member
    Join Date
    Apr 2011
    Posts
    20
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    Do you have the library in your class path?
    You mean, other than using import x;? I have never done that before, I have no idea how to do that :(

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  5. #5
    Boreeas's Avatar
    Boreeas is offline Member
    Join Date
    Apr 2011
    Posts
    20
    Rep Power
    0

    Default

    Hmm, I'm obviously doing something wrong.


  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    are you using an IDE?

  7. #7
    Boreeas's Avatar
    Boreeas is offline Member
    Join Date
    Apr 2011
    Posts
    20
    Rep Power
    0

    Default

    I'm using NetBeans

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  9. #9
    Boreeas's Avatar
    Boreeas is offline Member
    Join Date
    Apr 2011
    Posts
    20
    Rep Power
    0

    Default

    Ah, I figured it out. I had to download a .jar file. What a mess, but at least now I know how to do it in the furture. Thanks for your help!

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Importing a cvs library
    By malaguena in forum New To Java
    Replies: 2
    Last Post: 03-15-2011, 12:48 AM
  2. importing a library into my program
    By sniffer139 in forum NetBeans
    Replies: 1
    Last Post: 03-22-2010, 02:29 PM
  3. I want to put the native library in library path in mac os x
    By Hussain Ali in forum Advanced Java
    Replies: 2
    Last Post: 02-24-2010, 08:55 AM
  4. Importing JXL API
    By ryanlbowen in forum New To Java
    Replies: 0
    Last Post: 07-17-2009, 08:17 PM
  5. Tell me jar file for library library org.bouncycastle.cms
    By 82rathi.angara in forum New To Java
    Replies: 10
    Last Post: 09-09-2008, 06:11 AM

Posting Permissions

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