Cannot find symbol even though it's there.

I am having an issue compiling a java class in oracle. I have a java class that will run an executable. I want to call that java class from a difference class and when I try to compile that class, it fails with Cannot Find Symbol.
This is what errors, and it errocs when I declare ec as ExecCMD.
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "MS_FS_FUNCTIONS" AS
import java.io.*;
import java.util.*;
import java.sql.*;
import oracle.sql.*;
import ms_fs_execcmd.ExecCMD.*;
public class exportPDF
    public static String export_PDF(String p_pdf_contents)
        ExecCMD ec ;
       ec = new ExecCMD("ExportPDFData.exe");
        return "string";
This is the class im trying to call.
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED MS_FS_EXECCMD AS
package ms_fs_execcmd;
import java.util.*;
import java.io.*;
public class ExecCMD
    public static void main(String args[])
        try
        {   if (args.length > 0 ){        
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec(args[0]);
                InputStream stderr = proc.getErrorStream();
                InputStreamReader isr = new InputStreamReader(stderr);
                BufferedReader br = new BufferedReader(isr);
                String line = null;
                System.out.println("<ERROR>");
                while ( (line = br.readLine()) != null)
                System.out.println(line);
                System.out.println("</ERROR>");
                int exitVal = proc.waitFor();
                System.out.println("Process exitValue: " + exitVal);
        } catch (Throwable t)
            t.printStackTrace();
here is the error message.
[Error]  (0: 0): MS_FS_FUNCTIONS:11: cannot find symbol
[Error]  (0: 0): symbol  : constructor ExecCMD(java.lang.String)
[Error]  (0: 0): location: class ExecCMD
[Error]  (0: 0):        ec = new ExecCMD("ExportPDFData.exe");
[Error]  (0: 0):             ^
[Error]  (0: 0): 1 error

Bill,
I'm having exactly the same problem with trying to install Portal 4.0. Has
anybody given you an answer to this problem?
Thanks,
Bill Goggin wrote:
I recently moved my evaluation copy of WebLogic 6.1 SP 1 from /opt to
/usr/local on my RedHat 7.1 box. WebLogic runs fine from the new
location. However, when I try to install my evaluation copy of WLPortal
4.0, it insists that WebLogic 6.1 SP 1 is not installed in my BEA_HOME,
even though it is. I've uninstalled and re-installed WebLogic many
times, but it still won't work. Does the uninstall miss some files? Has
anyone else had this problem?

Similar Messages

  • ITunes cannot find files even though the path is correct in Preferences

    Hello: I have a problem that is not addressed in any support article.
    When I click to play a song in iTunes, I get the message that iTunes cannot find the original file.
    When I check Preferences > Advanced > iTunes folder locations, I see all of my files there, but iTunes does not.
    I have reset, consolodated the library, and performed all tasks noted in the support articles. Still no luck.
    Can anyone help?
    Thanks very much.
    Tophersteele
    PowerPC G5 iMac   Mac OS X (10.4.8)  

    I had the same thing happen and have been pulling my hair out about this for a week now. Finally today I hit on a fix that worked for me and I hope it works for you.
    For this to work, you need a backup of the last saved iTunes Library file.
    First, follow directions about locating your iTunes music folder. In prefs>advanced choose your location and make sure that is right.
    Locate your last saved iTunes Library file (the one that was working before things went haywire with the !'s everywhere). Also locate the iTunes prefs file in ~/library/prefs. For me, these were part of a Backup, so I selected "restore" ONLY THESE particular files from my last backup. When prompted to replace existing files, I said YES.
    After backup ran, restoring the old Library and replacing the corrupted one, I relaunched iTunes and VOILA. All files were now correctly linked.
    This left one last task, re-importing all songs I'd imported since that previous backup. To find these, I sorted my music folder by date modified and checked the most recent songs against the most recent in my Library. (sort your iTunes LIbrary by "Date Added", which you can add manually if it's not part of your categories bar.

  • Portal install can't find WebLogic even though it's there.

    I recently moved my evaluation copy of WebLogic 6.1 SP 1 from /opt to
    /usr/local on my RedHat 7.1 box. WebLogic runs fine from the new
    location. However, when I try to install my evaluation copy of WLPortal
    4.0, it insists that WebLogic 6.1 SP 1 is not installed in my BEA_HOME,
    even though it is. I've uninstalled and re-installed WebLogic many
    times, but it still won't work. Does the uninstall miss some files? Has
    anyone else had this problem?

    Bill,
    I'm having exactly the same problem with trying to install Portal 4.0. Has
    anybody given you an answer to this problem?
    Thanks,
    Bill Goggin wrote:
    I recently moved my evaluation copy of WebLogic 6.1 SP 1 from /opt to
    /usr/local on my RedHat 7.1 box. WebLogic runs fine from the new
    location. However, when I try to install my evaluation copy of WLPortal
    4.0, it insists that WebLogic 6.1 SP 1 is not installed in my BEA_HOME,
    even though it is. I've uninstalled and re-installed WebLogic many
    times, but it still won't work. Does the uninstall miss some files? Has
    anyone else had this problem?

  • Libdnla problems.. CANNOT FIND LIBAVFORMAT even though its installed.

    I am attempting to compile libdnla fromlibdlna-0.2.3.tar.bz2 
    I have installed ffmpeg and any other dependencies.
    ffmpeg is installed.  I cant even get past the ./configure becuase i get this:
    [root@warrior] $ ./configure
    Checking for compiler available...
    Checking for libavformat ...
    Error, can't find libavformat !
    See file "config.log" produced by configure for more details.
    [/home/delaney/Desktop/libdlna-0.2.3 :: 04:53 PM :: 0]
    [root@warrior] $
    This of course makes no sense because a simple locate of libavformat provides me with:
    [root@warrior] $ locate libavformat
    /usr/include/libavformat
    /usr/include/libavformat/avformat.h
    /usr/include/libavformat/avio.h
    /usr/include/libavformat/rtsp.h
    /usr/include/libavformat/rtspcodes.h
    /usr/lib/libavformat.a
    /usr/lib/libavformat.so
    /usr/lib/libavformat.so.52
    /usr/lib/libavformat.so.52.17.0
    /usr/lib/pkgconfig/libavformat.pc
    Someone has to know a workaround.
    help me please?
    looking forward to a response.  thanks in advance.
    zen...
    Last edited by thewayofzen (2008-10-07 19:57:40)

    Read the comments on the AUR page.

  • Cannot find app, even though app store says i've downloaded it?

    Apps have dissappeared on my phone, but when I go to the app store to redownload, it says I have it

    Have you looked on a different page and inside folders?
    Does it show in a Spotlight search?
    Try a Reset: Hold the Sleep/Wake and Home buttons and don’t let go until the screen goes dark and the Apple logo appears (no data will be lost)

  • IPhoto can't find photo even though the thumbnail is present. Any help, there are dozens of photos in my library that won't open as iPhoto can't find them.

    iPhoto can't find photo even though the thumbnail is present. Any help, there are dozens of photos in my library that won't open as iPhoto can't find them. This is probably a very common question!

    With the amount of information you've provided it's impossible to offer a potential solution.  We need to know the details of your problem and situation, i.e.:
    what version of iPhoto are you using?
    what system version are you running?
    what do you see when you launch iPhoto to open your library?
    what fixes have you tried before coming here?
    where is you library located?
    how long has this been occuring?
    did you apple any updates or upgrades just prior?
    are you running a "managed" or "referenced" library?
    what type of Mac?
    how much free space on your boot drive?
    What do you see when you click on a thumbnail?
    OT

  • Cannot find symbol:constructor

    here is my code...
    package org.tiling.didyoumean;
    import java.io.IOException;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.BufferedReader;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.queryParser.ParseException;
    import org.apache.lucene.search.Query;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.search.spell.SpellChecker;
    import org.apache.lucene.store.Directory;
    import org.apache.lucene.store.FSDirectory;
    import org.apache.commons.cli.ParseException;
    public class spell {
         public static void main(String args[]){
              System.out.println("hi");
         String spellIndex = "C://opt//lucene//didyoumean//indexes//spell";
         SpellChecker spellChecker = new SpellChecker(spellIndex);
         String[] similarWords = spellChecker.suggestSimilar("jva", 1);
         System.out.println(similarWords[0]);
    }and the error i am kept getting is
    C:\Documents and Settings\sumit-i\Desktop\didyoumean\didyoumean-1.0\src\java>javac org/tiling/didyoumean/spell.java
    org\tiling\didyoumean\spell.java:29: cannot find symbol
    symbol  : constructor SpellChecker(java.lang.String)
    location: class org.apache.lucene.search.spell.SpellChecker
            SpellChecker spellChecker = new SpellChecker(spellIndex);
                                        ^
    1 errorany ideas..plzz

    here is the Directory.java,....please help me if you can....actually i have a deadline to submit this..but i am not getting this...
    package org.apache.lucene.store;
    * Licensed to the Apache Software Foundation (ASF) under one or more
    * contributor license agreements.  See the NOTICE file distributed with
    * this work for additional information regarding copyright ownership.
    * The ASF licenses this file to You under the Apache License, Version 2.0
    * (the "License"); you may not use this file except in compliance with
    * the License.  You may obtain a copy of the License at
    *     http://www.apache.org/licenses/LICENSE-2.0
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    import java.io.IOException;
    /** A Directory is a flat list of files.  Files may be written once, when they
    * are created.  Once a file is created it may only be opened for read, or
    * deleted.  Random access is permitted both when reading and writing.
    * <p> Java's i/o APIs not used directly, but rather all i/o is
    * through this API.  This permits things such as: <ul>
    * <li> implementation of RAM-based indices;
    * <li> implementation indices stored in a database, via JDBC;
    * <li> implementation of an index as a single file;
    * </ul>
    * Directory locking is implemented by an instance of {@link
    * LockFactory}, and can be changed for each Directory
    * instance using {@link #setLockFactory}.
    * @author Doug Cutting
    public abstract class Directory {
      /** Holds the LockFactory instance (implements locking for
       * this Directory instance). */
      protected LockFactory lockFactory;
      /** Returns an array of strings, one for each file in the
       * directory.  This method may return null (for example for
       * {@link FSDirectory} if the underlying directory doesn't
       * exist in the filesystem or there are permissions
       * problems).*/
      public abstract String[] list()
           throws IOException;
      /** Returns true iff a file with the given name exists. */
      public abstract boolean fileExists(String name)
           throws IOException;
      /** Returns the time the named file was last modified. */
      public abstract long fileModified(String name)
           throws IOException;
      /** Set the modified time of an existing file to now. */
      public abstract void touchFile(String name)
           throws IOException;
      /** Removes an existing file in the directory. */
      public abstract void deleteFile(String name)
           throws IOException;
      /** Renames an existing file in the directory.
       * If a file already exists with the new name, then it is replaced.
       * This replacement is not guaranteed to be atomic.
       * @deprecated
      public abstract void renameFile(String from, String to)
           throws IOException;
      /** Returns the length of a file in the directory. */
      public abstract long fileLength(String name)
           throws IOException;
      /** Creates a new, empty file in the directory with the given name.
          Returns a stream writing this file. */
      public abstract IndexOutput createOutput(String name) throws IOException;
      /** Returns a stream reading an existing file. */
      public abstract IndexInput openInput(String name)
        throws IOException;
      /** Returns a stream reading an existing file, with the
       * specified read buffer size.  The particular Directory
       * implementation may ignore the buffer size.  Currently
       * the only Directory implementations that respect this
       * parameter are {@link FSDirectory} and {@link
       * org.apache.lucene.index.CompoundFileReader}.
      public IndexInput openInput(String name, int bufferSize) throws IOException {
        return openInput(name);
      /** Construct a {@link Lock}.
       * @param name the name of the lock file
      public Lock makeLock(String name) {
          return lockFactory.makeLock(name);
       * Attempt to clear (forcefully unlock and remove) the
       * specified lock.  Only call this at a time when you are
       * certain this lock is no longer in use.
       * @param name name of the lock to be cleared.
      public void clearLock(String name) throws IOException {
        if (lockFactory != null) {
          lockFactory.clearLock(name);
      /** Closes the store. */
      public abstract void close()
           throws IOException;
       * Set the LockFactory that this Directory instance should
       * use for its locking implementation.  Each * instance of
       * LockFactory should only be used for one directory (ie,
       * do not share a single instance across multiple
       * Directories).
       * @param lockFactory instance of {@link LockFactory}.
      public void setLockFactory(LockFactory lockFactory) {
          this.lockFactory = lockFactory;
          lockFactory.setLockPrefix(this.getLockID());
       * Get the LockFactory that this Directory instance is
       * using for its locking implementation.  Note that this
       * may be null for Directory implementations that provide
       * their own locking implementation.
      public LockFactory getLockFactory() {
          return this.lockFactory;
       * Return a string identifier that uniquely differentiates
       * this Directory instance from other Directory instances.
       * This ID should be the same if two Directory instances
       * (even in different JVMs and/or on different machines)
       * are considered "the same index".  This is how locking
       * "scopes" to the right index.
      public String getLockID() {
          return this.toString();
       * Copy contents of a directory src to a directory dest.
       * If a file in src already exists in dest then the
       * one in dest will be blindly overwritten.
       * @param src source directory
       * @param dest destination directory
       * @param closeDirSrc if <code>true</code>, call {@link #close()} method on source directory
       * @throws IOException
      public static void copy(Directory src, Directory dest, boolean closeDirSrc) throws IOException {
          final String[] files = src.list();
          if (files == null)
            throw new IOException("cannot read directory " + src + ": list() returned null");
          byte[] buf = new byte[BufferedIndexOutput.BUFFER_SIZE];
          for (int i = 0; i < files.length; i++) {
            IndexOutput os = null;
            IndexInput is = null;
            try {
              // create file in dest directory
              os = dest.createOutput(files);
    // read current file
    is = src.openInput(files[i]);
    // and copy to dest directory
    long len = is.length();
    long readCount = 0;
    while (readCount < len) {
    int toRead = readCount + BufferedIndexOutput.BUFFER_SIZE > len ? (int)(len - readCount) : BufferedIndexOutput.BUFFER_SIZE;
    is.readBytes(buf, 0, toRead);
    os.writeBytes(buf, toRead);
    readCount += toRead;
    } finally {
    // graceful cleanup
    try {
    if (os != null)
    os.close();
    } finally {
    if (is != null)
    is.close();
    if(closeDirSrc)
    src.close();
    please let me know....if you any idea about it..
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Javac = "cannot find symbol" when compiling class referencing other classes

    I have several Java files in a directory which is declared as a package at the start of the files
    package filemanager;
    This program works perfectly in an IDE, however I'm having problems with compiling in command line.
    I have set the classpath as I understand to be right for my computer to:
    C:\Program Files\Java\jdk1.6.0_02\bin
    I can compile a class that references no other classes in this package/directory.
    However files which reference other classes bring up such errors:
    javac AllFiles.javaAllFiles.java:174: cannot find symbol
    symbol : variable Bob
    location : class filesmanager.AllFiles
    Bob.getItem(itemRef);
    Where Bob is an example of another class. Even though I can say, compile Bob on it's own as it doesnt have any such reference.
    I've tried:
    javac -cp "C:\Program Files\Java\jdk1.6.0_02\bin" AllFiles.javaThis also failed.
    Any ideas?
    Edited by: ajr87 on Feb 8, 2008 10:26 AM

    I've tried spoon_'s suggestion, but I'm still getting the error ("cannot find symbol"). Here is my code:
    File Hello/Fred.java:
    package Hello;
    public class Fred
        public int age;
        public Fred()
            this.age = 1;
    } // public class FredFile Hello/Hello.java:
    package Hello;
    public class Hello
        public static void main(String args[])
            Fred fred = new Fred();
            System.out.println("Fred is " + fred.age);
    } // public class HelloAnd here is my attempt to compile Fred.java and Hello.java:
    C:/Users/levner/programs[219]javac -cp c:\users\levner\programs\hello Hello\Fred.java
    C:/Users/levner/programs[220]javac -cp c:\users\levner\programs\hello Hello\Hello.java
    Hello\Hello.java:14: cannot find symbol
    symbol  : class Fred
    location: class Hello.Hello
            Fred fred = new Fred();
            ^
    Hello\Hello.java:14: cannot find symbol
    symbol  : class Fred
    location: class Hello.Hello
            Fred fred = new Fred();
                            ^
    2 errorsI am doing this work on a PC running Vista using javac 1.6.0_10. I've tried various combinations of upper and lower case names for the package and file names, and I always get the same errors.
    Thanks in advance for your help. David

  • Help a Beginner? cannot find symbol error?

    class Box {
         double width;
         double height;
         double depth;
    Box(Box ob) {
              width = ob.width;
              height = ob.height;
              depth = ob.depth;
    Box(double w, double h, double d) {
         width = w;
         height = h;
         depth = d;
    double volume() {
         return width * height * depth;
    class BoxWeight extends Box {
         double weight;
         BoxWeight(double w, double h, double d, double m) {
              width = w;
              height = h;
              depth = d;
              weight = m;
    class DemoBoxWeight {
         public static void main(String[] args) {
              BoxWeight mybox1 = new BoxWeight(10, 20, 35, 34);
              double vol;
              vol = mybox1.volume();
              System.out.println("Weight of mybox1 is " + mybox1.weight);
    okay, this is basically from a book, but when I compile it in TextPad, it reads
    C:\Documents and Settings\Guest 1\Desktop\EPGY C015\Box\Box.java:27: cannot find symbol
    symbol : constructor Box()
    location: class Box
         BoxWeight(double w, double h, double d, double m) {
         ^
    1 error
    Tool completed with exit code 1
    Why is that and how can I fix it? :P

    Whenever you extend a class (here you're extending Box with BoxWeight), and create the subclass's constructor, the parent class's (or super class's) constructor gets called first whether it is explicitly called or not. So here in the BoxWeight constructor, the Box constructor is implicitly called:
    BoxWeight(double w, double h, double d, double m) {
      // even though you don't specify it, the Box() constructor is called here. 
      // it's as if you have here the call:
      super();
      width = w;
      height = h;
      depth = d;
      weight = m;
    }If you don't specify the super(), it get's implicitly called as the first call in the BoxWeight constructor. Notice that the implicit constructor has no parameters. Since Box does not have a constructor without parameters, this will throw an error. To get around this, you should explicitly call the super constructor with its proper parameters as the first method called in your BoxWeight constructor:
    BoxWeight(double w, double h, double d, double m) {
      super(w, h, d);  // *** here ***
      width = w;
      height = h;
      depth = d;
      weight = m;
    }

  • The Traditional "cannot find symbol" error

    As i already come across thru this error but i still getting clear about this. When i try to compile my VendServlet.java file the compiler shows this stupid error and i even check the classpath and all other formal check that we do when this kinda error comes. But it shows the same error. I even delete the class file of RMACPModel.java and re-compile
    the file but it seems no worth of it. What can i do? And here the error msg for u
    C:\apache-tomcat-6.0.16\webapps\rmanew\WEB-INF\classes\com\rajk\javacode\servlet
    s>javac -classpath c:\apache-tomcat-6.0.16\lib\servlet-api.jar VendServlet.java
    VendServlet.java:14: cannot find symbol
    symbol  : class RMACPModel
    location: class com.rajk.javacode.servlets.VendServlet
            RMACPModel n = new RMACPModel();
            ^
    VendServlet.java:14: cannot find symbol
    symbol  : class RMACPModel
    location: class com.rajk.javacode.servlets.VendServlet
            RMACPModel n = new RMACPModel();
                               ^
    2 errorsThe source package of all the files was com.rajk.javacode.servlets. And all the class files were there and i even checj that too. But still it shows error.Whats wrong with my Servlet File?

    Are all files placed in the same package/folder? Are all classes declared to belong to that package? Are you sure that you have typed the class name correct? (Java is case sensitive)
    Kaj

  • Please help with cannot find symbol error. Been struggling all day :(

    Hi all. :)
    Writing a game for my phone with KToolbar and have been getting a cannot find symbol error for every variable and method I try to use across Classes. I've looked all over and though it seems a common problem I always either don't understand or can't get working the various solutions. Example of my errors:
    C:\...\BTK800i.java:197: cannot find symbol
    symbol : variable youSayWhat
    location: class HelloCanvas
              youSayWhat=key;
              ^
    If I try BTK800i.variable or BTK800i.message I get a new error.
    C:\...\src\BTK800i.java:184: non-static method newOrdersSarge() cannot be referenced from a static context
              BTK800i.newOrdersSarge();
              ^
    Both these errors apply to both variables and methods. It only happens when I'm using methods/variables of one class in another, am I using public and private incorrectly? It doesn't seem to make a difference if I make variables public or leave them private, I'm trying to get to them with a public method within a private class. Is it something else? I really have no idea. :(
    Here's my code, it's long enough to be a tiresome read so I've tried to skip what I know isn't relevant.
    public class BTK800i extends MIDlet {
         private Display myDisplay;
         private HelloCanvas myCanvas;
         public int youSayWhat;
            //a whole bunch more skipped here, but I'm fairly certain it's not anything that'll help find a solution
         public BTK800i() {
              paused=false;
    public void startApp() throws MIDletStateChangeException {
              if( paused ) {
                   myCanvas.repaint();
              else {
                   myDisplay=Display.getDisplay(this);
                   myCanvas=new HelloCanvas();
                   myDisplay.setCurrent(myCanvas);
                   myCanvas.setFullScreenMode(true);
                   youSayWhat=0;
                           //again with the skipping, more code not related
    public void newOrdersSarge() {
    //whole bunch of code
    //other methods skipped
    class HelloCanvas extends Canvas {
         public void keyPressed (int key) {
              youSayWhat=key;
              repaint ();
    //skippage
    }The stuff I skipped is mainly either more of the same sorta thing or maths/writing to screen stuff.
    Thanks alot to anyone who helps. I'm really struggling with this. :(
    Dan.

    But I have been reading them :(
    My next-door neighbour unfortunately is an 80-something married man, but I will go have a looksie about static and instances.
    I thought the point of public variables was that other classes could use them, is this wrong?
    Also does this mean that to use the variables from my BTK class in the HelloCanvas class I need to first instantiate BTK? I don't understand how that works as the code starts running from the BTK class in the first place :S I guess more reading will help with this.
    Thanks very much for replying. :)
    Edit:
    OK I have read up on it but I don't think I found anything I hadn't read before. I tried to make a new class which I could instantiate to hold all the variables and methods I wanted everything to be able to access, but that went disastrously. Am I right in understanding that there are no global variables in Java? :s
    Edited by: Dan69 on Apr 17, 2010 1:15 PM

  • Cannot find symbol : class ! problem

    Hello,
    I have 2 java files (CD.java & CDCatalog.java) in a package called "testPackage". I can compile CD.java, but CDCatalog.java (that creates CD instances) gives following error - cannot find symbol symbol : class CD
    Below are the 2 files, please tell me why I get this errors , thanks!
    1) CDCatalog.java
    package testPackages;
    import java.util.Hashtable;
    //import testPackages.CD;
    public class CDCatalog {
    /** The CDs, by title */
    private Hashtable catalog;
    public CDCatalog( ) {
    catalog = new Hashtable( );
    // Seed the catalog
    addCD(new CD("Nickel Creek", "Nickel Creek", "Sugar Hill"));
    addCD(new CD("Let it Fall", "Sean Watkins", "Sugar Hill"));
    addCD(new CD("Aerial Boundaries", "Michael Hedges", "Windham Hill"));
    addCD(new CD("Taproot", "Michael Hedges", "Windham Hill"));
    public void addCD(CD cd) {
    if (cd == null) {
    throw new IllegalArgumentException("The CD object cannot be null.");
    catalog.put(cd.getTitle( ), cd);
    2) CD.java
    package testPackages;
    public class CD {
    private String title;
    private String artist;
    private String label;
    public CD( ) {
    // Default constructor
    public CD(String title, String artist, String label) {
    this.title = title;
    this.artist = artist;
    this.label = label;
    public String getTitle( ) {
    return title;
    public void setTitle(String title) {
    this.title = title;
    public String getArtist( ) {
    return artist;
    public void setArtist(String artist) {
    this.artist = artist;
    public String getLabel( ) {
    return label;
    public void setLabel(String label) {
    this.label = label;
    public String toString( ) {
    return "'" + title + "' by " + artist + ", on " +
    label;
    }

    just tried it as well, no problems, provided you
    compile CD.java firstI just tried from the shell ans look at this...
    E:\testPackages>dir
    Volume in drive E is MYFLASHDISK
    Volume Serial Number is 483B-B160
    Directory of E:\testPackages
    05/24/2006  07:48 PM    <DIR>          .
    05/24/2006  07:48 PM    <DIR>          ..
    05/24/2006  07:20 PM             1,143 CD.java
    05/24/2006  07:50 PM             1,053 CD.class
    05/24/2006  07:56 PM               972 CDCatalog.java
                   3 File(s)          3,168 bytes
                   2 Dir(s)   1,024,503,808 bytes free
    E:\testPackages>javac -cp e:\testPackages CDCatalog.java
    CDCatalog.java:30: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
        public void addCD(CD cd) {
                          ^
    CDCatalog.java:24: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Nickel Creek", "Nickel Creek", "Sugar Hill"));
                      ^
    CDCatalog.java:25: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Let it Fall", "Sean Watkins", "Sugar Hill"));
                      ^
    CDCatalog.java:26: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Aerial Boundaries", "Michael Hedges", "Windham Hill"));
                      ^
    CDCatalog.java:27: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Taproot", "Michael Hedges", "Windham Hill"));
                      ^
    5 errors
    E:\testPackages>I am now officially confused. I even specified the exact path to the CD.class file and javac still didnt like it.
    I'll dig some more. It has to be related to the classpath some how..
    JJ
    Still Stumped.. I'll sleep on it..
    Message was edited by:
    Java_Jay

  • Cannot find Symbol :class CLOB

    Hi,
    I am using JDK1.5.0_06 and Oracle8.1.7.
    When i compile java program I am getting the following error
    cannot find symbol
    symbol : class CLOB
    I have added classes12.zip into classpath.
    Can anybody tell me why this errpr comes? Is there any other files instead of classes12.zip to be added (since its JDK1.5 version? )
    Thanks in advance
    neema

    you have mentioned about the class "studentList" but that class is not to be found in the code you have pasted. its instead "ListTest". And the "menu" function seems to b a part of "ListTest" class. Can you provide the structure of the classes "studentList" and "Student" so that the problem can be more clearly understood?
    also you are using the variable "Stdin" in the line int choice = Stdin.readInteger(); where as you have not declared this variable.
    in the "switch" statement you are calling two different functions for the same case "3" where as it should be "case 3" and "case 4" respectively.
    in the "main" you are calling the "menu" function without any parameter while you actually want to pass argument of type "studentList".

  • "cannot find symbol : class Scanner"  error message

    I have an error message that says:
    "cannot find symbol : class Scanner"
    I tried typing at the top of the program
    import java.util.Scanner;but I still have the same error message.
    What should I do ?
    Thank you in advance

    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
    Since:
    1.5
    look at the javadoc, it says since 1.5 so it's not there in earlier versions.
    just a guess

  • Cannot find symbol class error

    hi there ,
    i am creating a min class that links several classes and i am doing the following
    public class Main{
         public static void main(String[] args){
         classOne a = new classOne();
    classTwo b = new classTwo();
    classThree c = new classThree();
    // more classes with the same as above
    i am saving all the classes in the same folder , and i am having this error twice with each line that i creat an instance for a class
    cannot find symbol
    symbol : class classOne

    are your classes all in the same package? do you in fact use packages?
    Your best bet to get help here is by creating a Short, Self Contained, Correct (Compilable), Example or SSCCE. This is a small application that you create that is compilable and runnable, and demonstrates your error, but contains no extraneous, unnecessary code that is not associated with your problem. To see more about this and how to create this, please look at this link:
    http://homepage1.nifty.com/algafield/sscce.html
    Remember, this code must be compilable and runnable.
    Also, if you do post your code, please use code tags so that your code will be well-formatted and readable. To do this, either highlight your code block and press the "code" button at the top above the message block or place the tag &#91;code&#93; at the top of your block of code and the tag &#91;/code&#93; at the bottom, like so:
    &#91;code&#93;
       // your code block goes here
    &#91;/code&#93;

Maybe you are looking for