1.5 issues


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: 1.5 issues

  1. #1
    Join Date
    Mar 2004
    Posts
    635

    1.5 issues

    I've installed the new sdk and have already fixed any problems with deprecated methods. I'm getting another error though. In BlueJ, it says my class uses unchecked or unsafe operations. When I compile from the command prompt:

    C:\>java d:\programming\java programs\jtunes2\MainFrame.java

    Exception in thread "main" java.lang.NoClassDefFoundError: d:\programming\java


    I get the same error on one other class as well, but everything else compiles fine.


    Here's the other class that won't compile. It's simple, and I can't see what problems it would have.

    Code:
    import java.util.Vector;
    import java.io.Serializable;
    
    
    public class AlbumMix implements Serializable
    {
        private String name;
        private Vector songs = new Vector();
        private double totalSize = 0.0;
        
        public AlbumMix(String n)
        {
            name = n;    
        }
        
        public AlbumMix()
        {
            name = "New Mix";
        }
        
        public void addSong(MP3 song)
        {
            songs.add(song);
        }
        
        public Vector getList()
        {
            return songs;
        }
        
        /*
         * Returns number of songs in album
         */
        public int getSize()
        {
            return songs.size();
        }
    
        public String toString()
        {
            return name;
        }
        
        public void addToTotalSize(double size)
        {
            totalSize += size;
        }
        
        public void subtractFromTotalSize(double size)
        {
            totalSize -= size;
        }
        
        /*
         * Returns the size of the album in Kbytes
         * Album size determined by all the file sizes that 
         * make up this album
         */
        public double getSizeKB()
        {
            return totalSize;
        }
    }

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    Both classes use Vector. After looking at the documentation, 1.5 has changed it I think.

    1.4
    add(Object o)

    1.5
    add(E o)

    I don't know what this "E" is or if it may be a bug in their documentation. But it just links me back to the Vector class when I click it.

  3. #3
    Join Date
    Mar 2004
    Posts
    635

  4. #4
    Join Date
    Sep 2004
    Posts
    223
    When you say that you type this:

    C:\>java d:\programming\java programs\jtunes2\MainFrame.java

    Do you mean this:

    C:\>javac d:\programming\java programs\jtunes2\MainFrame.java

    because that error means that it hasnt been compiled yet and you are trying to run the .java file rather than the .class file...
    A kram a day keeps the doctor......guessing

  5. #5
    Join Date
    Mar 2004
    Posts
    635
    oops. you can tell i dont use the command line too often for java.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center