Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to set classpath

Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
package p1;
public class Super
public void print()
import p1.*;
class Sub
public static void main(String a[])
new Super().print();

i compile the the file and create the package p1. then i compile the file in same location it gives an error message like

E:\JSF>javac cannot access Super
bad class file: .\
file does not contain class Super
Please remove or make sure it appears in the correct subdirectory of the classpa
new Super().print();
1 error

who can i solve this problem
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Did you put the compiled file Super.class inside the p1 directory?
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if THIS helps. At step 3 it introduces a directory structure that matches the package structure. That's the most natural way to set things up.
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic