command prompt is compilation is not working

Ads
 

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

Ads









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... command prompt. To create a database we need to use 'create database name
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
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
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
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 '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'
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
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 '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 '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
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

Ads