Class Path Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinls1247
    New Member
    • Oct 2007
    • 1

    #1

    Class Path Problem

    I am baffled as to why i keep receiving a "java.lan.NoCla ssDefFoundError : C:\Ini
    Exception in thread "main".

    My CLASSPATH is C:\javapgm\test App\WEB-INF\classes\tes tenv;C:\oracle\ ora92\jdbc\lib\ classes12.jar;

    My class file has been created. Now i need to know what exactly is causing this error outside of CLASSPATH being set.

    Code:
    import java.util.Properties;
    import java.util.Vector;
    import java.io.FileInputStream;
    import java.io.File;
    
    public class IniA
    {
          private static Properties m_ApiProperties = null;     
          private static sFile = "C:\\readFile.ini";
                
      public IniA()
      {
          
      }
          public static void loadProperties(boolean bShowDebug, String sFile)
          {    	
        	 // String sFile = "readFile.ini";
    	      try
    	      {  
    	        File objFile = new File(sFile);	
    	        if( objFile.canRead() )
    	        {
    	          FileInputStream fin = new FileInputStream(objFile);
    	          m_ApiProperties = new Properties();
    	          m_ApiProperties.load(fin);
    	        }
    	      }
    	
    	      catch(java.io.FileNotFoundException e)
    	      {
    	       // FTTrace.handleMessage (FTTrace.HANDLER_APP_PT_MSG,"     ERROR: FileNotFoundException = " + e.getMessage());
    	      }
    	      catch(java.io.IOException e)
    	      {
    	        //FTTrace.handleMessage(FTTrace.HANDLER_APP_PT_MSG,"     ERROR: IOException = " + e.getMessage());
    	      }
          
           }
          
     
          public static void main(String pstrArgs[]) 
          {                             // simple unit test
    
       	   try{
                              IniA();
                            }
     catch(Exception x) 
       	  	{
       	      System.out.println(x);	   
       	 	}
           System.out.println("HI");
          }
    }
    Attached Files
    Last edited by NeoPa; Oct 17 '07, 10:29 PM. Reason: Please use [CODE] tags
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32668

    #2
    I'm assuming this is a Java question.
    It had something in the untagged code with "Java" in it :S
    No idea of the title but I found it posted in a completely unrelated discussion thread in the Member Introductions forum. I suppose you'd better be gentle with them.
    **Edit**
    Changed title but it was really a guess so please change it if it's not right.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Why don't you post the full error message exactly as it is.

      Comment

      Working...