Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners command prompt is compilation is not working

Have Programming Question? Ask it here!
 
 
 


ashokkumar
command prompt is compilation is not working
3 Answer(s)      2 years and 3 months ago
Posted in : Java Beginners


Dear java users can anyone help me to run the program in command line prompt i tried by selecting the environment variable and class path and path in my system my program is compiling and generation the class file using javac c:\helloworld.java command and the class file is also getting generated when i run the class file using java helloworld through command prompt class not found error and class loader not able to load and many exception are coming can anyone help me to sort this problem please and iam using windows 7 os

thanking u from ashokkumar


Advertisement
View Answers

January 16, 2012 at 12:43 PM


Hi,

Post the error. Where is your class located? Is it in C:// drive?



January 16, 2012 at 1:00 PM


hai

the error is class not found exception java.lang.class not found exception

E:\Users\ASHOKKUMAR R>"javac" "e:\Program Files\Java\HelloWorld.java"

E:\Users\ASHOKKUMAR R>"java" "e:\Program Files\Java\HelloWorld"
Exception in thread "main" java.lang.NoClassDefFoundError: e:\Program Files\Java
\HelloWorld
Caused by: java.lang.ClassNotFoundException: e:\Program Files\Java\HelloWorld
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: e:\Program Files\Java\HelloWorld.  Program will e
xit.

E:\Users\ASHOKKUMAR R>

and my code is


public class HelloWorld
{
  public static void main(String[] args)
  {
    System.out.println("Hello, World!");
  }
}

my sdk location is E:\programfiles\java\jdk1.0.6\bin

my code location is E:\programfiles\java\HelloWorld.java

my os is windows 7



January 16, 2012 at 10:28 PM


Hello Ashok kumar if you are using windows7 then first set your user variable in advance system setting give the variable name- path and the variable value- C:\Program Files\Java\jdk1.6.0_23\bin; if you are install your java in C drive

after that you set your system variable in advance system setting use variable name- classpath variable value-C:\Program Files\Java\jdk1.6.0_23\jre\bin;; please give the semicolon where it is placed... after doing all this things you can run a java program using command line arguments just write java classname arguments



Related Tutorials/Questions & Answers:
command prompt is compilation is not working
command prompt is compilation is not working   Dear java users can anyone help me to run the program in command line prompt i tried by selecting... helloworld through command prompt class not found error and class loader not able
Command Prompt in UI
Command Prompt in UI  Hi, Is there any API or JAR file for running all the windows command prompt commands like dir,echo,ping commands? If any please tell me what is it? Thanks & Regards---Vanchinathan.R
Advertisements
Command Prompt in UI
Command Prompt in UI  Hi One Help... Please go through. I want to develop like that using jsp/javascript but nothing is striking in mind... Please give some suggestions to design first Thanks in advance---- Vanchinathan.R
run command prompt from jsp program
run command prompt from jsp program  Hi.... Is it possible to run a command prompt from jsp? If possible please help me with some code... Thanks & Regards vanchinathan.R
Prompt
into methods in the method asking for the input it uses a prompt command...) { System.out.print(**prompt** + ' '); return numberOfGrades } I don't undersant the prompt part
This Query is no working in sql developer it is giving Ora-0933 exception SQL command not properly ended exception
This Query is no working in sql developer it is giving Ora-0933 exception SQL command not properly ended exception  SELECT * from employees ORDER BY first_name limit 0,10;   Hi Friend, Please clarify your problem
prompt using
prompt using  I want examples to use prompt and how to move the item from the prompt to a cell in a table. thank you
using prompt
using prompt  how to use prompt
javascript for prompt - JSP-Servlet
javascript for prompt  Dear sir, I have used prompt() for taking a reason while deleting using java script its working fine but prompt was coming at the top left so i want that prompt should come at middle so how to do
javascript for prompt - JSP-Servlet
javascript for prompt  Dear Sir, I am using a prompt() for taking a reason for delete.I used your code,its working fine .but i am validating a prompt contains any special character or what.If contains a alert message has
What is a prompt box?
What is a prompt box?  What is a prompt box
javascript prompt alert
javascript prompt alert   Sending a prompt alert using a JavaScript function
javascript for prompt - JSP-Servlet
javascript for prompt  Dear sir, I am using prompt()for taking a reason from vendor . var reason=prompt('Reason for deleting:',''); Then i... an object ,so how to remove this script error.And also this prompt is coming
javservlet compilation error - Servlet Interview Questions
effects current command prompt u have exit current cmd prompt and strat fresh cmd prompt this will slove your problem  Hi Friend, Close your command...javservlet compilation error  hello sir I set the classpath
How to prompt user
How to prompt user  Dear Sir, I'm a new student, a beginner in Java. Pls help to write program as below :- a)to prompt user to input 2 integers, the 1st number entered as Digit 1 and 2nd number as Digit 2. b)Display the value
Hibernate compilation - Hibernate
Hibernate compilation  please explain how to compile and run Hibernate at command prompt ( in dos) with sample example
Prompt for a password when deleting a data
Prompt for a password when deleting a data  I am using netbeans and mysql. i have added a username and password. i have a set of data in the database. so when deleting a data it should prompt for the password and if the password
java compilation error - JSP-Servlet
your command prompt and compile your servlet and then restart the tomcat...java compilation error  sir ,i have jdk1.6.0_01 and textpad installed .I have also set classpath and path.But stil on compiling my servlet programs
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
Compute command
Compute command  hello, What is compute command?   hii, samar Compute command control computations on subsets created by the BREAK command
java compilation error - Servlet Interview Questions
:\program file\java\jdk1.6.0). You can either set this from the command prompt...java compilation error  when i compile my servlet java file i get the compilation error as import java.servlet.* not found  servlet
compilation fail
compilation fail  package jsptube.tutorials.servletexample; import javax.servlet.GenericServlet; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import java.io.IOException; import
java Compilation
java program compilation time following error is occur in my system Note
java Compilation
java program compilation time following error is occur in my system Note
java Compilation
java program compilation time following error is occur in my system Note
Print command
Print command  Can I use System.out.println command in Struts form bean or Struts action class. I am using Struts 1.3.8 but when I write this command...;You can use System.out.println command in Strut Action Class. The message written
compilation error
compilation error  Hi my program below is not compiling,when I try to compile it i'm getting the error message "tool completed with exit code 1".The loop has to be at the end of the program can you help me. Blockquoteimport
compilation errors
compilation errors  package jsptube.tutorials.servletexample; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import
Java compilation error - Java Beginners
Java compilation error  Hello, i am getting an error while running simple core java program on command prompt.java is installed on my pc... dos prompt if it is running and open the dos prompt once again. Read more
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir I am writing script in servlet,so prompt() is not working here so please help me...\"){"); out.println(" var reason=prompt('Reason for deleting
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir, I am using a prompt(),when a delete is confirmed,its working fine ,but when a prompt is closed or cancel ,i have to remain in the same page but here it is going
UITapgesturerecognizer not working
UITapgesturerecognizer not working  uitapgesturerecognizer not working
Excel Prompt User on Focus
Excel Prompt User on Focus In this section, you will learn how to prompt user on focusing the cell using Apache POI. EXAMPLE In the below example, you will learn how to prompt user on focusing the cell. Here, the message title
java compilation error - Hibernate
java compilation error  hi, i have made an registration page whosevalues should be inserted into database. i have used hibernate and eclipse it is working fine. but when i make a war file and deploy it using ant and then run
rmi compilation - Development process
rmi compilation  hi sir i'am developing a rmi application and to generate stub and skeleton i'll have to use rmic please tell me how to use rmic like javac by setting the path in command prompt like path="E
ALL command - SQL
ALL Command in Java & SQL  Nee all commands in Java.  Dear Manoj, I didn't get u what do u mean by all command. could u please... whether annotation processing and/or compilation is done. -processor
compilation errors - Swing AWT
compilation errors  how to create a window with five textFields, five labels and three buttons
java compilation error - Java Beginners
java compilation error  i have downloaded java software(version 6... command, error message is displayed javac is not recognized as an internal command or batch file then i looked into bin ,there is no javac file. plz tell me
htpasswd working
htpasswd working   hii, What does htpasswd do?   hello, htpasswd creates a new user in a specified group, and asks to specify a password for that user
Datagrid not working
Datagrid not working  The code here is working fine, apart from the fact that that I'm using netbeans 6.5 and the servlet v2.5 and struts 1.1.... working. please help me out
java compilation error - Applet
java compilation error  I am getting compilation error in the following code.: public void paint(Graphics g) { switch(screen) { case 0: g.drawString(line1,2,10); break; case 1
java compilation error - Hibernate
java compilation error  hi i am getting org.hibernate.exception.GenericJDBCException: Cannot open connection exception when runnig the code why this exception is coming
command line arguments - Java Beginners
command line arguments  how can i findout the minimum and maximum no's at the command prompt if i give some values?????????  hi friend... at the command prompt and then calculate the max and min numbers from them
iperf command in java
iperf command in java  How to write a code for iperf command in java
c++ system command
c++ system command   c++ system command variables and an example in real time of using the system command
Java Compilation error - JSP-Servlet
:\Program Files\Java\jre1.6.0\lib\ext also. Then close the command prompt...Java Compilation error  hi i m vipul chauhan , i having a problem with this package i download package from the location http://commons.apache.org
groovy compilation error - Framework
groovy compilation error  while i am running the grails application , i got the error message like: [groovyc...] [groovyc] 1 error Compilation error: Compilation Failed how we can resolve
How to invoke method of a library from command line
How to invoke method of a library from command line  Suppose there are two methods in a libray and you have to invoke one of the method from that library directly from the command prompt. How will you do
Why this is not working...?
Why this is not working...?  import java.util.*; public class Family { int size_of_family=0; public Person[] members=new Person[size_of_family]; Person d = new Person(); public Family (int size_of_family){ members = new
Advertisements
 

 

 

DMCA.com