Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    help regarding java!!!

    when i run this code it gives a UnKnownHost error.....plzz help me!!!


    public class SourceViewer {
    public static void main (String args[]){
    if (args.length>0){
    URL u=new URL(args[0]);
    URLConnection uc = u.openConnection();
    InputStream in = uc.getInputStream();
    in = new BufferedInputStream(in);
    Reader r = new InputStreamReader(in);
    int c;
    while((c = != -1){
    System.out.print((char) c);
    catch (MalformedURLException e) {
    System.err.println(args[0] + "is not a parseable URL");
    catch (IOException e) {

  2. #2
    did you gcj for compiling...
    were you able to compile the program

  3. #3
    yeah compilation was successful.....

  4. $spacer_open
  5. #4
    compiling was done by
    run command: ./java SourceViewer
    result: UnKnownHostError

  6. #5
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Lat: 39:03:51N Lon: 77:14:37W
    I don't know java yet (im taking a class this fall) but perhaps this is a DNS reolution error? ive done little programming that accesses network resources, but i always just used ips..... and they were generaly one shot deals or something just for my use. This would be better in the programming and scripting forum.
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

Posting Permissions

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