HELP, I CANT RUN ANY JAVA PROGRAMS

Hi again
thank you to the people who replyed to my last post.
i have downloaded the J2sdk1.4.0 from the sun web site and installed it but when ever i try to compile or run a programe dos says bad command or file name.
i have included the location of the 1.4.0 on my computers path like so C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PROGRA~1\PROTEC~1\j2sdk1.4.0-beta3\bin
but my computer cant seem to find it
can anyone at all help, it might seem silly so thats why ive posted this on a new to java forum.

No, thats not silly ;- ). Everything looks ok. Are you sure you entered the "EXACT" path to the jdk? Everything should look like:
SET PATH:<jdk>/bin
Also, make sure you reboot!
-Strider

Similar Messages

  • Help needed in running a  java program

    hi
    how to run a java program using another java program.
    i have tried a litte to run the notepad,mspaint applications sucessfully using the Runtime class,but how to specify a java program init . the program is given below
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("notepad" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }to run another java program how to modify the exec() or any other way to do this.

    thank u
    its working without any error but it doesn't print any thing on the screen.
    the program is
    this program to be run by cls.java
                                             // hello.java
    import java.io.*;
    public class hello
    public static void main(String[] args)
        System.out.println("hello world");
      }cls.java is given below
                                                    //cls.java
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("java  hello" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }

  • Cannot run any java Programs

    I cannot get any java applications to run whenever I try I get
    Exception in thread "main" java.lang.NoClassDefFoundError: jedit40install/jar
    for any application that I try to run. I was able to compile a application but not run it. I tried launching it via java -classpath . jeditinstall.jar and i recieved the error again. I am running RedHat 7.3 on a 686 with 512mb ram. Below are my enviroment variables that I have set.
    export JAVA_HOME=/usr/java/j2sdk1.4.0
    export PATH=$PATH:$JAVA_HOME/bin
    export CLASSPATH=.
    Any help would be appreciated.

    I'm not exactly sure of the root to your problem but maybe you can try setting the classpath to contain the JAR file that you are running?
    Also...I think you should be launching a JAR file by:
    java -classpath -jar jeditinstall.jar
    Hope this helps :)

  • How to set path to run a Java program?

    my pc os is win2000 service pack 3.
    cpu is celoron 667mhz
    256 pc133 sdram
    i have done the setting b4 run a java program but no any effect.
    setting as below:
    set path=c:\j2sdk1.4.1_01\bin
    set classpath=c:\j2sdk1.4.1_01\lib
    my java file is store in C:\Java, file name is HelloWorld.java, so when i type:
    C:\>
    C:\>Java\javac HelloWorld.java
    (the screen show me : java\javac not internal or external........")
    and i try again as follow:
    C:>
    C:>\Java>javac HelloWorld.java
    (the screen show : Exception in thread "main" java.lang.NoClassDefFoundError:HelloWorld/java)
    i cant do anymore, who can help me?

    you need to put the CLASSPATH to dir: c:\j2sdk1.4.1_01
    and also to the directory you are working
    For example, you are working in "C:\Myclasses". You need to put:
    set CLASSPATH = C:\j2sk1.4.1_01;C:\Myclasses;
    if you don't put your working directory, java doesn't find your classes
    Try it and luck!

  • I am not able to run the java Program

    Hi All,
    I am not able to run a java program... I am able to complie the program sucessfully when i am trying to run it i am getting a error:
    Exception  in thread "main" java.lang.NoClassFoundError : filename
    i have complie and run my programs frequently but now i am not able run my prevoius examples also ...
    Can u any body help me out...... I have also update the latest version of JRE but still my problem is not sloved.
    Thanks & Regards,
    Ravi

    Make sure you take package structure into account.
    If you have say
    package testing.things;
    public class Test
        public static void main(String[] args)
            System.out.println("World Hello");
    }in file Test.java, you compile it with (assuming your current working directory is at the folder in which the source file is located).
    javac -d . Test.javaand run it with
    java testing.things.TestThe -d . option creates the output at the current directory (with a folder structure matching your package structure).
    #

  • Running a java program from a .asp page

    i'm looking for someone in the community that knows how to run a java program
    on a web server ( not an applet) from a asp page. The server as IIS 5 and the jre1.3.1
    any help or tips would be welcomed

    The following site explains in detail how you have to do it. I have done it and it works fine.
    If u still have problems, contact me at [email protected]
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q167941

  • Error message when try to run copied java program

    Hi Java Guru,
    Can somebody help me with this issue ?
    I was copy my java source from java_ulangan2 to java_ulangan20, when i tried to run the java program, i get an error message.
    Below is the error message:
    05/01/2010 1:02:42 PM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] ERROR:
    [003]Deployment aborted
    Settings
    SDM host : wfmdev
    SDM port : 50018
    URL to deploy : file:/d:/DOCUME1/GunawanJ/LOCALS1/Temp/temp7843042886291622098Java_ulangan20.ear
    Result
    => deployment aborted : file:/d:/DOCUME1/GunawanJ/LOCALS1/Temp/temp7843042886291622098Java_ulangan20.ear
    Aborted: development component 'Java_ulangan20'/'local'/'LOKAL'/'0.2010.01.05.13.02.32'/'0':Caught exception during application deployment from SAP J2EE Engine's deploy service:java.rmi.RemoteException: Cannot deploy application local/Java_ulangan20.. Reason: Clusterwide exception: Failed to deploy application local/Java_ulangan20. Check causing exception for details (trace file). Hint: Are all referenced components deployed and available on the engine?; nested exception is:      com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to deploy application local/Java_ulangan20. Check causing exception for details (trace file). Hint: Are all referenced components deployed and available on the engine? (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
    Deployment exception : The deployment of at least one item aborted
    I really appreciate any kind of help.
    Thanks,
    JGN

    Hi John.
    In past i have faced same problem for the same task. Take help of the Basis team provide tham .ear file name and ask then to un-deploy the file from the server cluster.
    After this deploy your application again.
    Hope this may help you.....:)
    Deepak!!!

  • I could not run any application program

    I could not run any application program( even thouht the simplest one such as helloword). It would give NoClassDefoundError as:
    Exception in thread "main" java.lang.NoClassDefFoundError: Welcome1
    Press any key to continue . . .
    I use text pad editor. First I compile it, there is no error. But when I try to run ( by click run java application program button ) it gives me the same error message.
    I also always have compile error such as no class define when I try compile the program which need to import user defined class from differerent package. ( even though I did put all the classed in the same directory and also use import statement)
    I did try to run many other applet programs which do not use any user defined class, in this case every thing work fine and I could run the program.
    That mean I could run simple applet program but not application, also i always have compile error when ever I tried to import user defined class.
    I'm afriad there is some thing wrong with the sdk and java enviroment, therefore I did try to uninstall the program and redownload from the web( I try both version 1.3 and 1.4 many time, and I did check the size of the application when I finish down load) but I still got the same problem.
    My computer operating system is WinMe.
    I appreciate any help
    Ha Tran

    When I was trying to write my final project(Client/Server Application with java & CORBA)I could not compile The simplest program like HelloWorld for Idl(Errors like yours).After two month accidentally I write set classpath= and HelloWorld start to work.I start to read the tutorial again,and I see that sun say it in the tutorial but I don't understand it because I read it fast.So it was somthing wrong with me not with sun.They work very hard.I like to work in sun in future.

  • How can i run my java program with out java language

    Hai to every one ..Iam new to java language ...am using windows xp operating system , i did not installed java language in my system .. how can i run a java program with out installing java language... Which files is requied to run java program..?
    any one can help me??

    Hai to every one ..Iam new to java language ...am
    using windows xp operating system , i did not
    installed java language in my system .. how can i run
    a java program with out installing java language...
    you ... can ... not ... do ... this
    Which files is requied to run java program..?
    any one can help me??a JVM. Download it from sun's website.
    [url http://java.sun.com/javase/downloads/index.jsp]Download JavaSE here

  • Error while running a Java Program

    Can anyone help me,
    I am getting the following error while running a Java program, Below is the exception thrown, please help.
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RESummer1.run(RESummer1.java:505)
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RECollectCont.run(RECollectCont.java:304)

    Ok, let's see. Write the following class:
    public class Grunt {
      public static void main(String[] args) {
        System.out.println("Hello Mars");
    }Save it as "C:\Grunt.java", compile by typing:
    javac c:\Grunt.javaRun by typing:
    java -classpath "C:\" GruntDoes it say "Hello Mars"? If yes, go back to your program and compare for differences (maybe you used the "package" statement?).
    Regards

  • Running a java program via a batch file

    I am unable to run a java program from a batch file that I created.
    spiderpackage.EntryPoint is a class file which I am trying to run with a -v option to output something.What should I do to get the output?
    echo ^<html^>^<body^>
    echo hello^<br^>
    call java spiderpackage.EntryPoint -v
    echo ^</body^>^</html^>

    This has nothing to do with java programming. Have a look at the windows help for the call command.
    The echo <html> stuff doesn't make sense. What's it for?
    The command in you batch file should be:
    java -cp . spiderpackage.EntryPoint -v
    assuming that java is in the system path, and the EntryPoint.class is in a directory called spiderpackage which is a subdirectory of your current working directory

  • Running a Java program at startup in Linux

    Hello
    How do I run a Java program at startup in Linux? I know in Windows I can put a .bat file in C:\Windows\Start Menu\Programs\StartUp\ directory, but in Linux I have no idea how it is done.
    Thank you,
    Mihai

    This is really a Linux question, not Java.
    And then it depends on the version of Linux you are using.
    Maybe this will help, otherwise you should try on a forum for your version of Linux.

  • Running a java program in a directory other than the current directory

    How do I run a java program that's located in a directory other than the current directory?
    There is a file Test.java in /dir1/subdir1. If my current directory is anywhere other than that directory, say /dir2/subdir2, I can compile Test.java by using:
    javac -classpath /dir1/subdir1 /dir1/subdir1/Test.java
    But when I try to run it with:
    java -classpath /dir1/subdir1 /dir1/subdir1/Test
    I get a java.lang.NoClassDefFoundError: \dir1\subdir1\Test
    Any thoughts?

    You need to specify just the name of the class you want to run. So java -classpath /dir1/subdir1 Test

  • Not able to run a java program on Sun Solaris

    Hi All,
    I am getting following error while running a java program. Can you help.
    Thanks,
    --Srini
    Error:
    Exception in thread "main" java.lang.NoClassDefFound

    Hi Sergi,
    Thanks for the info. I couldn't able to login because of my internet connection.
    Thanks,
    --Srini                                                                                                                                                                                                                           

  • URGENT: How to run a Java program from a different directory?

    Hi.
    How do I run a Java program from a directory that the file is not located in? So lets say im in c:\Java. But the file is in c:\Java\abc\efg\.
    What would be the command to run the Java file from c:\Java.
    I can't remember it and I need it asap.
    Cheers.

    If the class you are trying to run is MyApp.class, try
    c:\Java\>java -cp abc\efg MyAppThe actual classpath you specify will depend on whether or not MyApp.class is in a package (I've assumed it isn't) and whether or not any 3rd party jars are involbed (I've assumed not).
    Edited by: pbrockway2 on Apr 1, 2008 6:42 PM
    The command arguments read as "Run the MyApp class using as a classpath abc\efg relative to here (c:\Java)".

Maybe you are looking for

  • Restore from time machine after clean install of Mavericks

    I decided to do a clean install of Mavericks to get rid of all the very old files hiding in my system folders.  I made a startup disk following online instructions, rebooted from the USB drive and wiped the drive and reinstalled Mavericks.  Then I pl

  • Go back to day one. I have no start up disk I do have my copy of Snow Leopard 10.6.3

    I have two questions. I want to install Lion. I tried to install more memory I have two 512 MB I try to install a 2 GB stick.that did not work PowerLite flashes. So I'm back to 1 GB. I only have 4 GB left on my 160 GB hard drive. There is nothing on

  • XY graph "mouse move" event stops generating when click on cursor

    Hello All When the mouse is moving freelly inside the XY graph control, the "mouse movement" event is fired. The same happens when muse clicks anywhere in the graph with the exception of cursors. hen mouse clicks on cursors the "mouse move" event is

  • Boxes are not printing after taking print out

    Dear All, i have developed a script ,which contains some rows and columns.To display rows and columns i have used BOX command.In print preview all boxes are coming properly,but if i take Print out(Even in PDF view also) some boxes are not printing.Wh

  • Macbook Air not recognizing anything connected via USB?

    My MB Air is not recognizing anything that I connect via USB...camera, harmony remote, phone, toys - nothing!  Nothing is showing up as being recongnized...anyone else having this problem?  I have tried virtually every device...what the heck?