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 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

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
What is command prompt in Java?
What is command prompt in Java?  Hi, What is command prompt in Java? Thanks   Hi, On the Windows Command Prompt is a program to run... system them you can use the command prompt to compile the Java program. Command
Advertisements
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
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
How to connect to MySQL from command prompt?
How to connect to MySQL from command prompt? This video tutorial walks you through the steps to connect to MySQL from command prompt in Windows machine... to the command prompt and typing the “mysql <with arguments>&rdquo
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
How to check if ZooKeeper is running or up from command prompt
to check if ZooKeeper is running or up from command prompt? Thanks   Hi, to know the status any of the following command can be used: jps -l | grep...How to check if ZooKeeper is running or up from command prompt  Hi
Video Tutorial: How to create a database in MySQL using Command prompt?
How to create a database in MySQL using Command prompt MySQL is an Operation... is the video tutorial of "How to create database in MySQL using command prompt... in MySQL using command prompt. To create a database we need to use
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!ADS
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
ModuleNotFoundError: No module named 'prompt'
to install padas library. You can install prompt python with following command...ModuleNotFoundError: No module named 'prompt'  Hi, My Python... 'prompt' How to remove the ModuleNotFoundError: No module named 'prompt'
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
What is a prompt box?
What is a prompt box?  What is a prompt box
ModuleNotFoundError: No module named 'dob-prompt'
with following command: pip install dob-prompt After the installation of dob...ModuleNotFoundError: No module named 'dob-prompt'  Hi, My Python... 'dob-prompt' How to remove the ModuleNotFoundError: No module named 'dob
ModuleNotFoundError: No module named 'hyper-prompt'
with following command: pip install hyper-prompt After the installation...ModuleNotFoundError: No module named 'hyper-prompt'  Hi, My Python... 'hyper-prompt' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'prompt-box'
with following command: pip install prompt-box After the installation of prompt...ModuleNotFoundError: No module named 'prompt-box'  Hi, My Python... 'prompt-box' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'prompt-for-password'
prompt-for-password python with following command: pip install prompt...ModuleNotFoundError: No module named 'prompt-for-password'  Hi, My... named 'prompt-for-password' How to remove the ModuleNotFoundError
ModuleNotFoundError: No module named 'prompt-toolkit'
python with following command: pip install prompt-toolkit After...ModuleNotFoundError: No module named 'prompt-toolkit'  Hi, My... named 'prompt-toolkit' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'pv-prompt'
command: pip install pv-prompt After the installation of pv-prompt...ModuleNotFoundError: No module named 'pv-prompt'  Hi, My Python...-prompt' How to remove the ModuleNotFoundError: No module named 'pv
ModuleNotFoundError: No module named 'pv-prompt'
command: pip install pv-prompt After the installation of pv-prompt...ModuleNotFoundError: No module named 'pv-prompt'  Hi, My Python...-prompt' How to remove the ModuleNotFoundError: No module named 'pv
ModuleNotFoundError: No module named 'sphinx-prompt'
with following command: pip install sphinx-prompt After...ModuleNotFoundError: No module named 'sphinx-prompt'  Hi, My... 'sphinx-prompt' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sphinx-prompt'
with following command: pip install sphinx-prompt After...ModuleNotFoundError: No module named 'sphinx-prompt'  Hi, My... 'sphinx-prompt' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'argparse-prompt'
python with following command: pip install argparse-prompt After...ModuleNotFoundError: No module named 'argparse-prompt'  Hi, My... named 'argparse-prompt' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'dob-prompt'
with following command: pip install dob-prompt After the installation of dob...ModuleNotFoundError: No module named 'dob-prompt'  Hi, My Python... 'dob-prompt' How to remove the ModuleNotFoundError: No module named 'dob
ModuleNotFoundError: No module named 'http-prompt'
with following command: pip install http-prompt After the installation of http...ModuleNotFoundError: No module named 'http-prompt'  Hi, My Python... 'http-prompt' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'hyper-prompt'
with following command: pip install hyper-prompt After the installation...ModuleNotFoundError: No module named 'hyper-prompt'  Hi, My Python... 'hyper-prompt' How to remove the ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'influx-prompt'
with following command: pip install influx-prompt After...ModuleNotFoundError: No module named 'influx-prompt'  Hi, My... 'influx-prompt' How to remove the ModuleNotFoundError: No module named
javascript prompt alert
javascript prompt alert   Sending a prompt alert using a JavaScript function
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
UITapgesturerecognizer not working
UITapgesturerecognizer not working  uitapgesturerecognizer not working
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
Hibernate compilation - Hibernate
Hibernate compilation  please explain how to compile and run Hibernate at command prompt ( in dos) with sample example
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
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
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
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
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
ModuleNotFoundError: No module named 'django-prompt-responses'
install django-prompt-responses python with following command: pip install...ModuleNotFoundError: No module named 'django-prompt-responses'  Hi...: No module named 'django-prompt-responses' How to remove the ModuleNotFoundError
ModuleNotFoundError: No module named 'ipython-venv-path-prompt'
can install ipython-venv-path-prompt python with following command: pip...ModuleNotFoundError: No module named 'ipython-venv-path-prompt'  Hi...: No module named 'ipython-venv-path-prompt' How to remove
ModuleNotFoundError: No module named 'prompt-tool-kit'
python with following command: pip install prompt-tool-kit After...ModuleNotFoundError: No module named 'prompt-tool-kit'  Hi, My... named 'prompt-tool-kit' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'prompt-toolkit-menu'
prompt-toolkit-menu python with following command: pip install prompt-toolkit...ModuleNotFoundError: No module named 'prompt-toolkit-menu'  Hi, My... named 'prompt-toolkit-menu' How to remove the ModuleNotFoundError
ModuleNotFoundError: No module named 'prompt-tr-free'
python with following command: pip install prompt-tr-free After...ModuleNotFoundError: No module named 'prompt-tr-free'  Hi, My... named 'prompt-tr-free' How to remove the ModuleNotFoundError: No module named

Ads