• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2 Questions - I'm Really At A Loss!

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below is my program Access.java which resides in c:\java.
It generates a "NoClassDefFoundError" when I run it. I have No idea why. Also, I've always had to put a package statement
at the top of all my .java files. Otherwise, they will compile, but won't run. To run Access.java, I compile it, then copy
Access.class to c:\com\gfarms\geometry then run it at c:\java
by doing java com.gfarms.geometry.Access
My 2 questions are:
1. Why do I get this "NoClassDefFoundError" when I run Acces.java?
2. What is wrong with my classpath, that requires me to put a package statement in all my .java files?
Anyway, here's my path and classpath statements in c:\autoexec.bat
path=c:\windows;c:\windows\command;c:\jdk1.3.0_02\bin;c:\java\;
set classpath=c:\jdk1.3.0_02\lib;c:\java\;
Finally, here's my c:\java\Access.java program that blows up:
//Access.java
package com.gfarms.geometry;
class Other
{
public void fnc(String b)
{
int y = 10;
System.out.println("string received = " + b);
System.out.println("y = " + y);
}
}
public class Access
{
public static void main(String[] args)
{
Other a = new Other();
a.fnc("Gary Farms");
}
}
Any help to my 2 above questions would be deeply appreciated!
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gary I answered this in beginner. PLEASE do not cross post.
reply
    Bookmark Topic Watch Topic
  • New Topic