Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 9 of 9

This is a discussion on java package error within the General Chat section, part of the Chrome Forum News category: Hi All Im getting package error for this please anyone help me with this.Im attaching image of Error got when ...


  1. #1
    swth is offline Junior Member
    Join Date
    Apr 2009
    Posts
    4

    Post java package error

    Hi All

    Im getting package error for this please anyone help me with this.Im attaching image of Error got when i run the program

    import java.io.InputStream;
    import java.io.IOException;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;


    public class Ps {
    public static void main(String[] args) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec
    (System.getenv("windir")+"\\system32\\"+"tasklist.exe");
    BufferedReader input = newBufferedReader(newInputStreamReader(p
    .getInputStream()));
    while ((line = input.readLine()) != null) {
    // Write your own parser to parse the data
    here.
    System.out.println(line);
    }
    input.close();
    } catch (Exception err) {
    err.printStackTrace();
    }
    }
    }
    Attached Thumbnails Attached Thumbnails img.jpg  

  2. #2
    Kyrax is offline Senior Member
    Join Date
    Apr 2009
    Location
    Qc, Canada
    Posts
    495

    Default

    First of all.. How does this piece of java code have to do with anything related to Chrome plugins ?

    Second, i bet this is some kind of homework ?

    Third, why don't you use an IDE like eclipse instead of compiling your java through the console ?

    Quote Originally Posted by swth View Post
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;


    public class Ps {
    public static void main(String[] args) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec
    (System.getenv("windir")+"\\system32\\"+"tasklist.exe");
    BufferedReader input = newBufferedReader(newInputStreamReader(p
    .getInputStream()));
    while ((line = input.readLine()) != null) {
    // Write your own parser to parse the data
    here.
    System.out.println(line);
    }
    input.close();
    } catch (Exception err) {
    err.printStackTrace();
    }
    }
    }
    Oh well.. I'll still fix your problem.

    This seems like some kind of people of code you copied from somewhere.
    No offense but .. you obviously don't know much about programming,

    After every " new ", there should be a space.

    Code:
    BufferedReader input = newBufferedReader(newInputStreamReader(p
                                            .getInputStream()));
    Should be
    Code:
     BufferedReader input = new BufferedReader(new InputStreamReader(p
                                            .getInputStream()));
    This line
    Code:
      // Write your own parser to parse the data
    here.
                                   System.out.println(line);
    Is what is causing your compilation error. The comment "// Write your own parser to parse the data
    here." should be on a single line. Right now, the "here." is not commented (if you were using ANY decent IDE, you would have realised that.. heck even any decent text editor would tell you that it's not commented).

    It should be
    Code:
    // Write your own parser to parse the data here.
                                   System.out.println(line);
    Now stop trying to get people from forums to do your homework and learn how to code.

    Or at least post it on a Java forum.
    Last edited by Kyrax; 04-21-2009 at 12:27 AM.

  3. #3
    StevePaul's Avatar
    StevePaul is offline Senior Member
    Join Date
    Mar 2009
    Location
    Birmingham, England
    Posts
    1,522

    Default

    I think your last line summed it up ...

    Politely referring the author of the post to a Java forum would have sufficed instead of the critical rhetoric !!

  4. #4
    Kyrax is offline Senior Member
    Join Date
    Apr 2009
    Location
    Qc, Canada
    Posts
    495

    Default

    I had the ability to solve his problem. I don't see why i'd refer him to another place just so he can get the same answer as I've given to him.

    And now that the post is in the General chat section, i don't see why i'd send him to somebody else.

    Thread should be closed imo.

  5. #5
    StevePaul's Avatar
    StevePaul is offline Senior Member
    Join Date
    Mar 2009
    Location
    Birmingham, England
    Posts
    1,522

    Default

    My comments were aimed at your rather disparaging remarks about, and I quote 'homework' ...

  6. #6
    swth is offline Junior Member
    Join Date
    Apr 2009
    Posts
    4

    Post

    Quote Originally Posted by StevePaul View Post
    My comments were aimed at your rather disparaging remarks about, and I quote 'homework' ...
    Hi

    This not any homework or something else Im just trying to display the task manager .i just want to connect this with google chrome thats all so that i can display task manager in chrome instead of using page-develpoer-task manager.

  7. #7
    swth is offline Junior Member
    Join Date
    Apr 2009
    Posts
    4

    Post

    Quote Originally Posted by Kyrax View Post
    I had the ability to solve his problem. I don't see why i'd refer him to another place just so he can get the same answer as I've given to him.


    And now that the post is in the General chat section, i don't see why i'd send him to somebody else.

    Thread should be closed imo.

    Hi

    This not any homework or something else Im just trying to display the task manager .i just want to connect this with google chrome thats all so that i can display task manager in chrome instead of using page-develpoer-task manager.

  8. #8
    StevePaul's Avatar
    StevePaul is offline Senior Member
    Join Date
    Mar 2009
    Location
    Birmingham, England
    Posts
    1,522

    Default

    I would suggest you don't try and 'reinvent the wheel' ...

    Its not necessary to have to do everything in Chrome ...

    All computers have some kind of inbuilt Task Manager (easily accessible using keyboard shortcuts), use it, that's what its there for !!

  9. #9
    Kyrax is offline Senior Member
    Join Date
    Apr 2009
    Location
    Qc, Canada
    Posts
    495

    Default

    Ok swth, sorry if I sounded rude.. but really it seemed like your weren't aware of how to code in java.

    If you figure out how to plug java code inside Chrome... let me know.

    EDIT : Unless you intend on generating a web page with your task manager on it.

Similar Threads

  1. java plugin for chrome
    By swth in forum Chrome Troubleshooting
    Replies: 2
    Last Post: 04-17-2009, 06:29 PM
  2. Major Error
    By nycfreed in forum Bugs and Vulnerabilities
    Replies: 0
    Last Post: 02-01-2009, 01:33 AM
  3. Java again
    By Quelebu in forum Chrome Plugins
    Replies: 2
    Last Post: 12-04-2008, 10:01 PM
  4. java-plugin
    By zaiko2000 in forum Chrome Plugins
    Replies: 1
    Last Post: 11-06-2008, 01:13 PM
  5. Java not working on Managerzone
    By Andrea Campisano in forum Bugs and Vulnerabilities
    Replies: 0
    Last Post: 10-17-2008, 03:12 PM

Posting Permissions

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