[nbusers] Could Not find or load main class (file)

  • From: "Dsr122076" < >
  • To:
  • Subject: [nbusers] Could Not find or load main class (file)
  • Date: Mon, 15 Oct 2012 10:53:22 -0400


Bayless Kirtley wrote:
> The jar file specifies the original path to its main class. By moving to 
> another location, it has been changed.
> 
> 
> -----Original Message----- 
> From: Dsr122076
> Sent: Monday, October 15, 2012 7:45 AM
> To: address-removed
> Subject: [nbusers] Could Not find or load main class (file)
> 
> Ok I am new to programming. In fact This is my second week in class. We are 
> using Netbeans to program. I am able to get my program compiled and to run 
> in the netbeans environment. However, when I copied the .java file to 
> c:\java programs file folder to attempt to do the same from the command 
> line 
> it complies and creates the .class file. I can see both the .java and 
> .class 
> in the same folder.
> I then try to run the program i type :   java (filename without the .class 
> portion). I get the following message: could not find or load main class 
> (filename).
> 
> Can someone tell me what I am doing wrong?
> BTW CLASSPATH is pointing to jdk1.7.0_07\bin
> PATH is pointing to many files including the jdk file as well.
> 
> 
> 
> 
> 
> 
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2013.0.2740 / Virus Database: 2601/5831 - Release Date: 10/14/12


.jar file?  I made the file .java in netbeans. I then copied it to c:\java 
programs . I then used the javac command to compile and it created the .class 
file. But I still cannot run the class file from thecommand prompt.

Are you telling me that I need to copy the program into notepad then rename 
it .java and compile it?






[nbusers] Could Not find or load main class (file)

Dsr122076 10/15/2012

[nbusers] Re: Could Not find or load main class (file)

Bayless Kirtley 10/15/2012

[nbusers] Could Not find or load main class (file)

Dsr122076 10/15/2012

[nbusers] Could Not find or load main class (file)

Dsr122076 10/15/2012

[nbusers] Could Not find or load main class (file)

Dsr122076 10/15/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close