Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!gy7g2000vbb.googlegroups.com!not-for-mail From: PortisHead Newsgroups: comp.lang.java.programmer Subject: Unable to use package...why ??? Date: Tue, 25 Oct 2011 00:06:16 -0700 (PDT) Organization: http://groups.google.com Lines: 47 Message-ID: <280344ac-b398-44b3-b775-e84859feb5f0@gy7g2000vbb.googlegroups.com> NNTP-Posting-Host: 46.177.69.80 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1319526837 12397 127.0.0.1 (25 Oct 2011 07:13:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 25 Oct 2011 07:13:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: gy7g2000vbb.googlegroups.com; posting-host=46.177.69.80; posting-account=RvwFhgoAAADSmgiBx6UcmbtPYQKPW3Im User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9165 Hello , I'm new to Java and tried the following. First I created the file : Getbcard.java inside the directory : C:\myclasses\exam\test\dok below is the script : package exam.test.dok; public class Getbcard { public void setname() { System.out.println("Hello"); } } then , I compiled it using this command line: javac Getbcard.java and got the appropriated .class file: Getbcard.class Next , I created a new file , named : Showbcard.java in folder : C: \examples below is the script : import exam.test.dok.*; public class Showbcard { public static void main(String[] args) { System.out.println("Showbcard"); Getbcard i = new Getbcard(); i.setname(); } } then , I compiled it using this command line: javac -cp c:\myclasses Showbcard.java and got the appropriated .class file: Showbcard.class Now when I try to execute the file like : java -cp c:\myclasses Showbcard I get the error : Could not find or load main class Showbcard What am I doing wrong here ? Many , many thanks in advance