Please help me with java packages...

Hey guys,
Im pretty new to java and I have some questions on packages.
My friend gave me a bunch of .java files. Now, each of the files has package edu.nyu.sejava.gc.util; as the beginning.
I know that the package name = directory structure but Im not sure on other things.
Do I have to put all of the .class files in a directory
C:\edu\nyu\sejava\gc\util? Is there a specific way I need to compile the files?
I compiled the files with 'javac -d c:\classes *.java' and the class files were put in a dir C:\classes\edu\nyu\sejava\gc\util. However, when I try to run one of them, I get
C:\classes\edu\nyu\sejava\gc\util>java LogTest
Exception in thread "main" java.lang.NoClassDefFoundError: LogTest (wrong name: edu/nyu/sejava/gc/util/Log)
Im confused. Why doesnt it see my class def for LogTest?
Any help is greatly appreciated. :)
Thanx
Flack

Run the class using the full name. e.g.
java edu.nyu.sejava.gc.util.LogTest
Make sure the classpath includes c:/classes and/or the current directory.

Similar Messages

  • Please help me with java

    Hi,
    I've finally able to get Java running on my mac again. But in the process I delete an unrecoverable folder. Without it, anything written with ObjCJava will not run. Can someone be kind enough to zip up your copy of this folder and let me download it? or email it to me?
    /System/Library/Java/com
    Thank you. Cool
    Oh, I forgot the mention that I'm using 10.4.6 on MBP. So I would appreciate if it was from an intel mac, thanks.

    Hi,
    Thanks for your suggestion. But those files are not included in the java update. Those are the ObjCJava class file that apple wrote, not sun. And the only way to get it is either reinstall Tiger or copy from someone else's computer. And I would prefer to skip the pain or reinstalling.
    Cheers

  • Please help me with these java puzzle ?

    Dear all,
    My friend send me typical java puzzle about java.util.ArrayList
    which is getting messy. Please help me out. It's not a homework.
    Please help me with these java puzzle ?
    Dear all,
    My friend send me typical java puzzle about java.util.ArrayList
    which is getting messy. Please help me out. It's not a homework.
    import java.util.*;
    public class MyInt ______ ________ {
    public static void main(String[] args) {
    ArrayList<MyInt> list = new ArrayList<MyInt>();
    list.add(new MyInt(2));
    list.add(new MyInt(1));
    Collections.sort(list);
    System.out.println(list);
    private int i;
    public MyInt(int i) { this.i = i; }
    public String toString() { return Integer.toString(i); }
    ________ int ___________ {
    MyInt i2 = (MyInt)o;
    return ________;
    }Hints , fill the underlines with below :
    implements
    extends
    Sortable
    Object
    Comparable
    protected
    public
    i = i2.i
    i
    i2.i=i
    compare(MyInt o, MyInt i2)
    compare(Object o, Object i2)
    sort(Object o) sort(MyInt o)
    compareTo(MyInt o)
    compareTo(Object o)

    Dear all,
    My friend send me typical java puzzle aboutNotwithstanding your pathetic protestations typicial
    of all your posts this is NOT a typical java "puzzle"
    but is indeed a typical homework puzzle.
    And it's damn easy if you spent 30 minutes with a
    tutorial.
    DO YOUR OWN HOMEWORK!
    Hey i did it.
    import java.util.*;
    public class MyInt implements Comparable {
    public static void main(String[] args) {
    ArrayList<MyInt> list = new ArrayList<MyInt>();
    list.add(new MyInt(2));
    list.add(new MyInt(1));
    Collections.sort(list);
    System.out.println(list);
    private int i;
    public MyInt(int i) { this.i = i; }
    public String toString() { return Integer.toString(i); }
    public int compareTo(Object o){
    MyInt i2 = (MyInt)o;
    return i;
    }E:\>javac MyInt.java
    Note: MyInt.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    E:\>java MyInt
    [1, 2]

  • Please help me with the homework given to me by my teacher

    hello,i am new in java programming please help me with the home work given to me by my teacher at school, help me to build an interface that can work with this code.i can build an interface but i dont just understand this code.
    //references:
    //http://forums.techguy.org/development/570048-need-write-java-program-convert.html
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.FileReader;
    public class Translate
      public static void main(String [] args) throws IOException
        if (args.length != 2)
          System.err.println("usage: Translate wordmapfile textfile");
          System.exit(1);
        try
          HashMap words = ReadHashMapFromFile(args[0]);
          System.out.println(ProcessFile(words, args[1]));
    catch (Exception e)
          e.printStackTrace();
      // static helper methods
       * Reads a file into a HashMap. The file should contain lines of the format
       *    "key\tvalue\n"
       * @returns a hashmap of the given file
      @SuppressWarnings("unchecked")
      private static HashMap ReadHashMapFromFile(String filename) throws FileNotFoundException, IOException
        BufferedReader in = null;
        HashMap map = null;
        try
          in = new BufferedReader(new FileReader(filename));
          String line;
          map = new HashMap();
          while ((line = in.readLine()) != null)
            String[] fields = line.split("\\t", 2);
            if (fields.length != 2) continue; //just ignore "invalid" lines
            map.put(fields[0], fields[1]);
    finally
          if(in!=null) in.close(); //may throw IOException
        return(map); //returning a reference to local variable is safe in java (unlike C/C++)
       * Process the given file
       * @returns String contains the whole file.
      private static String ProcessFile(Map words, String filename) throws FileNotFoundException, IOException {
        BufferedReader in = null;
        StringBuffer out = null;
        try {
          in = new BufferedReader(new FileReader(filename));
          out = new StringBuffer();
          String line = null;
          while( (line=in.readLine()) != null ) {
            out.append(SearchAndReplaceWordsInText(words, line)+"\n");
        } finally {
          if(in!=null) in.close(); //may throw IOException
        return out.toString();
       * Replaces all occurrences in text of each key in words with it's value.
       * @returns String
      private static String SearchAndReplaceWordsInText(Map words, String text) {
        Iterator it = words.keySet().iterator();
        while( it.hasNext() ) {
          String key = (String)it.next();
          text = text.replaceAll("\\b"+key+"\\b", (String)words.get(key));
        return text;
       * @returns: s with the first letter capitalized
      String capitalize(String s)
        return s.substring(0,0).toUpperCase() + s.substring(1);
    }... here's the head of my pirate_words_map.txt
    hello     ahoy
    hi     yo-ho-ho
    pardon me     avast
    excuse me     arrr
    yes     aye
    my     me
    friend     me bucko
    sir     matey
    madam     proud beauty
    miss     comely wench
    stranger     scurvy dog
    officer     foul blaggart
    where     whar
    is     be
    are     be
    am     be
    the     th'
    you     ye
    your     yer
    tell     be tellin'

    Heres your answer. Run it in on your pc.
    public class Annoy
    public static void main(String[] args)
       System.out.println("I am a triple poster.");
       System.out.println("I can not understand why I can not understand the help I have receved to date on the java forums.");
    }

  • Please help me with this error: "Apple application support was not found... Error 2"

    Can anyone please help me with this error: "Apple application support was not found... Error 2"
    I've followed the instructions by removing all Apple files from my laptop, but when I reinstall the iTunes software it still comes up with this message:
    "Apple application support is required to run iTunesHelper. Please uninstall iTunes, then install iTunes again. Error 2"
    Thank you

    iTunes "Apple Application Support is required... Error 2" and possible fix.
    I know this is a bit late but I came accross this thread trying to resolve this same problem and came up with a solution that worked for me, so thought I would share it here too. I hope it helps someone else.
    I just resolved this on Win Vista (should apply equally for Win7 too). Please uninstall iTunes before proceeding though. I'll walk you through the process I followed, if you like you can jump straight to the Solution section.
    Problems:
    The initial error during the installation of iTunes was:
    An error occurred during the installation of assembly 'Microsoft.VC80.CRT,version="8.0.50727.4053",type="win32",publicKeyToken='1fc8b 3b9a1e18e3b",processorarchitecture="x86". Please refer to Help and Support for more information. HRESULT:0x8007054F
    The error (after installing iTunes) when trying to run iTunes was:
    Apple Application Support is required to run iTunes. Please uninstall iTunes, then install iTunes again. Error 2 (Windows error 2).
    After trying various fixes around the forums I came across this MSKB article, which relates to the first installation error:
    http://support.microsoft.com/kb/2688946
    This lead me to trying to install MS Visual C++ but I received the following error trying to install that:
    Error 1935.An error occurred during the installation of assembly ‘Microsoft.VC80.ATL,type=”win32”,version=”8.0.50727.762”,publicKeyToken=”1fc8b3 b9a1e18e3b”,processorArchitecture=”amd64”’. Please refer to Help and Support for more information. HRESULT: 0x80070BC9. Assembly interface: IassemblyCacheItem, function: Commit, component: {837BF1EB-D770-94EB-A01F-C8B3B9A1E18E}
    Note: The installation of VC++ rolls back when it fails.
    Solution:
    Through this error I found this MSKB article:
    http://support.microsoft.com/kb/946414
    The Automated MS "Fix It" msi package didn’t work.
    Note: Please backup your registry first (see the above MSKB article for instructions).
    I opened the registry and (as instructed in the MSKB article) deleted the following keys:
    HKEY_LOCAL_MACHINE\COMPONENTS\
    PendingXmlIdentifier
    NextQueueEntryIndex
    AdvancedInstallersNeedResolving
    Reboot and reinstall iTunes.
    If it helps you please like this so others can find it.

  • Just Starting out with java packages

    Hello,
    I'm a beginner and I'm starting out with java packages.
    I wrote two simple .java files, one test program and one containing a simple class.
    Both files are compiling without errors but When I run the program I get an error NoClassDeffoundError.
    I use the import <package> statement And I think I'm using the CLASSPATH variable correctly.
    SET CLASSPATH=d:\nopol
    path for the .java containing the test class is:
    d:\nopol\utilities \myapp.
    In the test file I use "import utilities.myapp.*.
    I would be very happy if anyone could help me
    Thanks beforehand
    Nopol.

    The test file should be in d:\nopol, if it's not a part of your package utilities.myapp. Everything should be compiled from d:\nopol, the test class with "javac ClassName.java" and the class in the package with "javac utilities/myapp/ClassName.java".
    Your classpath seems fine for now, though. But yes, do add the period there, otherwise you could run into problems later.

  • Please help me with simple program

    Can someone please write a simple program for me that opens up a webpage in the center of the screen , with a set size, and then asks the user where they would like to click on the screen. Then once the person clicks it asks how many times they would like to click there, and then once they enter the # the program opens up the webpage (in the center at the same spot as before, with the same set size) and automatically clicks on the predesignated spot , and then closes all open internet windows, and keeps doing it for however many times the person chose. PLEASE HELP ME WITH THIS!!! If you could, please post the source code here. Thank you so much to whoever helps me!!!!!!!

    If it's not to learn, then what is the purpose of
    this project?well, if it's not HW and its not for learning java, then why the hell would anyone like to have a program that may open a webpage and then repeatedly click on predefined place...
    let me see...
    now if he had asked for program that fakes IP as well, then i would suggest that he tryes to generate unique clicks, but now... i'm not sure... maybe just voting in some polls or smthing... though, i would not create a program that clicks on the link or form element, but rather just reload url with given parameters for N times...

  • Please help me with msi installer file for 11.6.8.* as this is our standard version which we use for all machines in our organization

    please help me with msi installer file for 11.6.8.* as this is our standard version which we use for all machines in our organization

    arai-c wrote:
    I have full version of this software but I am not able to install it silently because it always gives Google toolbar pop up which We dont required
    arai-c wrote:
    the problem is we dont have msi file for 10.6.*.* and hence I am not able to create package for it
    I don't understand; two days ago you wrote that you have it, now you don't...?
    If you don't have it, then why not deploy the current version 12.1.3.153 - I don't see the point of installing an old, unsecure software version.

  • Very Urgent Please Help Me with XML parsing(DOM parser)

    Hi
    Please help me with the following code.
    I have an XML file
    <catalog>
    <book id="101">
    <title>First Ex With ID 101</title>
    <ID>500</ID>
    <author>RAJU</author>
    <price>39.95</price>
    </book>
    <book id="121">
    <ID>501</ID>
    <title>First Ex With ID 121</title>
    <author>RAJU1</author>
    <price>19.95</price>
    </book>
    </catalog>
    By using DOM parser I have to retrive ID values .After getting this ID values i have to pass these values in someother method of someother class.What i suppose to do?Can anyone help me with this regards ,if possible plese write the code..
    Regards
    Raju G

    Well first up all create a parser class where u parse the document using DOm and get the id node and assigen it to a String sat str.
    Now whatever processiong u want to do , u write in a separate class (say Process.java) in one method say doProcess(String str)
    Now from parser class u just call the doProcess() method with passing str as a parameter.
    eg.
    Process p = new Process();
    p.doProcess(str);
    Hope this will help u.
    ....yogesh

  • Help needed with java

    Hello everyone
    I'm a Student and new to java and I have been given a question which I have to go through. I have come across a problem with one of the questions and am stuck, so I was wondering if you guys could help me out.
    here is my code so far:
    A Class that maintains Information about a book
    This might form part of a larger application such
    as a library system, for example.
    @author (your name)
    *@version (a version number or a date)*
    public class Book
    // instance variables or fields
    private String author;
    private String title;
    Set the author and title when the book object is constructed
    public Book(String bookAuthor, String bookTitle)
    author = bookAuthor;
    title = bookTitle;
    Return The name of the author.
    public String getAuthor()
    return author;
    Return The name of the title.
    public String getTitle()
    return title;
    and below are the questions that I need to complete. they just want me to add codes to my current one, but the problem is I don't know where to put them and how I should word them, if that makes sense.
    Add a further instance variable/field pages to the Book class to store the number of pages in the book.
    This should be of type int and should be set to 0 in the Constructor.
    Add a second Constructor with signature
    public Book(String bookAuthor, String bookTitle, int noPages) so it has a third parameter passed to it as well as the author and title;
    this parameter is used - obviously?? - to initialise the number of pages.
    Note: This is easiest done by making a copy of the existing Constructor and adding the parameter.
    Add a getPages() accessor method that returns the number of pages in the book.
    Add a method printDetails() to your Book class. This should print out the Author title and number of pages to the Terminal Window. It is your choice as to how the data is formatted, perhaps all on one line, perhaps on three, and with or without explanatory text. For instance you could print out in the format:
    Title: Robinson Crusoe, Author: Daniel Defoe, Pages:226
    Add a further instance variable/field refNumber() to your Book class. This stores the Library's reference number. It should be of type String and be initialised to the empty String "" in the constructor, as its initial value is not passed in as a parameter. Instead a public mutator method with the signature:
    public void setRefNumber(String ref) should be created. The body of this method should assign the value of the method parameter ref to the refNumber.
    Add a corresponding getRefNumber() accessor method to your class so you can check that the mutator works correctly
    Modify your printDetails() method to include printing the reference number of the book.
    However the method should print the reference number only if it has been set - that is the refNumber has a non-zero length.
    If it has not been set, print "ZZZ" instead.
    Hint Use a conditional statement whose test calls the length() method of the refNumber String and gives a result like:
    Title: Jane Eyre, Author: Charlotte Bronte, Pages:226, RefNo: CB479 or, if the reference number is not set:
    Title: Robinson Crusoe, Author: Daniel Defoe, Pages:347, RefNo: ZZZ
    Modify your setRefNumber() method so that it sets the refNumber field only if the parameter is a string of at least three characters. If it is less than three, then print an error message (which must contain the word error) and leave the field unchanged
    Add a further integer variable/field borrowed to the Book class, to keep a count of the number of times a book has been borrowed. It should (obviously??) be set to 0 in the constructor.
    Add a mutator method borrow() to the class. This should increment (add 1 to) the value of borrowed each time it is called.
    Include an accessor method getBorrowed() that returns the value of borrowed
    Modify Print Details so that it includes the value of the borrowed field along with some explanatory text
    PS. sorry it looks so messey

    1. In the future, please use a more meaningful subject. "Help needed with java" contains no information. The very fact that you're posting here tells us you need help with Java. The point of the subject is to give the forum an idea of what kind of problem you're having, so that individuals can decide if they're interested and qualified to help.
    2. You need to ask a specific question. If you have no idea where to start, then start here: [http://home.earthlink.net/~patricia_shanahan/beginner.html]
    3. When you post code, use code tags. Copy the code from the original source in your editor (NOT from an earlier post here, where it will already have lost all formatting), paste it in here, highlight it, and click the CODE button.

  • My MacBook Pro iTunes movie purchase is not showing in iTunes store movie purchases nor does it show on my iPad or Apple TV.  Can someone please help me with a solution?  Thanks.

      First of all, I live in Ho Chi Minh City, Vietnam. Sometimes, I use a VPN to search on the web here. I purchased Toy Story 3 on my MacBook Pro 2011 OS/X - Lion through iTunes.  I initially had trouble downloading it which may be due to being on and off the VPN but after a while it finally downloaded and shows up in my iTunes library on my MacBook. 
      Under my Apple ID account (which is the only Apple ID account I have), I look under purchase history and it shows that I paid for Toy Story which is where I got my Order # from.  But if you go to the iTunes Store then to the Quick Links then click on Purchased, under all my Movies, it does NOT show Toy Story 3 as one of my movies.
      Now when I go to my iPad (3rd gen.), Toy Story 3 does not show up under purchased movies (all or not on my iPad).  It does not show up on my Apple TV as well.  If I want to have Toy Story 3 on my iPad or Apple TV, then it says I have to purchase it again.
      I have searched for help via Apple support communities but so far none of their solutions have worked for me.  I have tried logging off iTunes & App Store on iPad and also shutting down the iPad.  I also made sure that under iTunes Preferences>Store that iTunes in the Clouds purchases is checked. Can someone please help me with this?  Your consideration is greatly appreciated.  Thanks.

    Thanks King_Penguin for taking time to read and reply. 
    I just purchased this movie on Thursday, May 15, so just a few days ago.  I have never had any trouble whatsoever since I have been in Vietnam.  I have downloaded several movies and even music and they have all synced to my respected Apple products except for this purchase. 
    Sorry, I don't quite understand what you mean by studios and different versions.  Could you please explain? 
    I checked my purchased list in my purchase history under my account and there are no hidden items. 

  • I bought a movie the movie Godzilla 2014 recently but it didn't show up in my library. I went check the itunes store and it wants me to buy it again. Please help me with this problem.

    I just bought this movie "Godzilla 2014" but it won't show in my Movie Library. I closed my Itunes and put it back on again but still won't show up. I checked my purchased list and it shows that I recently bought the movie but when I checked the itunes store it wants to buy the movie again. Please help me with this right away Apple.

    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support: Contacting Apple for support and service - this includes
    international calling numbers..
    For Mac App Store: Apple - Support - Mac App Store.
    For iTunes: Apple - Support - iTunes.

  • HELP!!!! My Hotmail no longer works with Safari v. 5.0.6 and my Imac Leopard operating system 10.5.8.  Please help me with any suggestions on what to do.  Thank you.

    HELP!!!! My Hotmail no longer works with Safari v. 5.0.6 and my Imac Leopard operating system 10.5.8.  Please help me with any suggestions on what to do.  Thank you.  I cannot find any new downloads for Safari that work with Leopard.  The newest ones only work with Lion.  My Firefox browser still works though but I would rather use Safari and cannot access any e-mails or send any e-mails via Safari.  This happened about 3 weeks ago and I thought it was just a glitch on Hotmail's site.  Now I realize Hotmail must have released an update that no longer works with Leopard 10.5.8.  PLEASE HELP ME!!!!  Thanks to anyone and everyone who reads this and attempts to help me.  I do not know what to do....

    Hi Sue,
    What exactly happens when trying Safari?
    They did change it to Outlook recently, but while not pretty, I can access mine with Safari 4.0 still...
    You can also set it up in Mail so you don't need a browser at all if you want.

  • Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon

    Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon

    See these previous discussions help.
    App Store Updates (but only Updates)...: Apple Support Communities
    Apps suddenly don't update: Apple Support Communities

  • Please help me with an error 1418...

    OK I have iPod mini 4GB and I have the latest iTunes installed 7.02 or something I don't know anymore.
    Anyway a sad iPod icon displayed on my screen a few days ago and I managed to restart it and to put it in a disk mode and then iTunes finally recognized iPod and I clicked on Restore and then Restore and Updated and after a few seconds during the restore process it says:
    An iPod 'iPod' couldn't be resoterd. An unknown error occurred (1418).
    I am desperate and i don't know what to do.
    I read almost everything about this but nothing helped.
    Please help me with any kind of solution...

    I did a Support Search for that error number and this is what I got. I hope one of these links helps:
    http://docs.info.apple.com/article.html?artnum=304508
    http://docs.info.apple.com/article.html?artnum=304996

Maybe you are looking for