Running java fro DOS windows

Hi, can somebody tell me how to run java files from the DOS window, in windows??? thanks

joej wrote:
ok, thanx, i did and i found i should write this javac javafile.java, but when i did i got this error "javac is not recognized as an internal or external command, operable program or batch file, what does that mean or what could it be causing it?In the dos-shell, when you type "javac" or any other commands, the shell searches it's available path for the command. In this case, "javac" was not included as part of the path that the does shell searches and therefore it returned that error.
Go to google and search for how to add javac to source path.

Similar Messages

  • I want to run java program on windows environment as background process

    Hi all
    I want to run java program on windows environment as background processSo command prompt return after executing java command and program on background In Linux we can do this easily �but I do not how to do this in windows
    for example look this programe
    import java.io.*;
    import java.util.*;
    public class TestClass {
         class ravi extends Thread{
              public void run(){
                   try {    
                        String target_file = "ravind.txt";
                        File targetfile = new File(target_file);
                        PrintWriter writer = new PrintWriter(new FileWriter(targetfile)) ;
                   for (int i =0 ; i < 100 ;i++ ){
                        Thread.sleep(10000);
                        writer.println(" ravindra shukla ");
              } catch (Exception e) {               
                             e.printStackTrace();
         public static void main(String[] args) {
              TestClass test1 = new TestClass();
              TestClass.ravi r1 = test1.new ravi();
              r1.start();          
    System.out.println(" return from main ");
    first i compile this
    javac TestClass.java
    then i run this by using this command
    java TestClass
    but becouse i put sleep on threads run function so it takes to much time to get return on command promt .... i want to run this programe as background process so command promt return as soon as i execute java command

    Thanks dude
    This solution �start java TestClass� works fine �. But it does not solve my problem
    It opens another black window and that black window persist till the life time of my program
    Is it possible application run on complete background without opening another black window �as in Linux

  • Can we run java programms on Windows XP?

    Hi experts..
    I installed JDK on Microsoft Windows XP Home Edition..but i am unable to run java programmes.
    can i run java programmes on Windows XP?? if so how??
    i will be very thankful..if any one solve this problem..

    Yes, you can. There's a bunch of things you need to do (mostly setting the path environment variable). You should look at the documentation that came with the JDK, and check out the many forum responses to problems in setting up the JDK on Win 2K and Win XP.
    HTH

  • How to run .java file in windows ?

    How to run .java file in windows without installing any program? Thx!

    First, U must make sure that there is JDK on your computer
    Then, set the envionment variables which the os can find your compiler and interpreter: javac java
    after those, you must complie your .java file to .class file, then you can excute it by java, for example " java helloworld"

  • Run java in dos

    anyone can tell how to use dos to run Java program?
    I learn Eclipse few month, so I dont know how to run java in dos. I did follow the install guide to set the PATH like that
    C:\Program Files\Java\jdk1.5.0_02\bin in "Path" in the User Variables
    but I type to run by typing "
    *c:>javac welcome1.java*
    it says "javac is not in internal or external command to execute this file.
    Did I miss something in that?
    Please kind help!!!

    did you have any luck in figuaring out how to use the dos compiler. You have to use a simple text editor like WordPad and then you save all your files in the same dir. I have been using a dos compiler for school, even thought I don't really care for them. It has been great practice getting around in dos again. And you don't have to access the Run Time Enviroment to get your program to run. just complie then first with javac filename.java and then run them with java filename.

  • Running java program at windows startup

    I need to run java program at startup and then it will continue to run in its own thread.
    Any body having idea how to do that programmatically?
    Zeeshan

    This is one option but this is not feasible in my scenario as this application will be running over a network which involves hundreds of computer so is there any way to do it programatically?
    I mean if I can load java class file through an exe file then I can load my class file in the startup using C++.
    Any Suggestions.
    thanks for the help
    regards,
    Zeeshan

  • Form become white after running java app. under windows XP

    Hi,
    i developed an application (Form base application) that connect to FTP server and connect to a server via telnet.
    The application is running fine until i'm trying to run it under Windows XP.
    when i'm running the applicaion under windows XP and sending data, the form become WHITE (looks like stuck program).
    the app. is still running but the user think the app. is stuck.
    i try to INVALIDATE the form every time the loop is sending the data and many more ideas but it is still become white.
    the app. is working greate under windows 2000, 98, ME.
    does anyone know this problem and how to fix it?
    Thanks Guy.

    i "just" develope an application that connected to an exsiting servers and upload data to them.
    the problem is that when i run this app. under windows XP, the screen ( the application created in "Form Base") become white, like the program is stuck.
    there is no error, it's seems to be an invalidate problem, but i try to out invalidate everywhere but it is still doen't fix this problem.
    the app. doesnot stuck, it is just looks like that!!!!!
    the weird thing is when i run this app. under all other windows, it's working fine.
    if anything is not clear, write back.
    thanks.

  • Error when run java file on windows 7 64bit

    unexpected failure: Error:Only x32 JVM supported
    java.io.IOException: Error:Only x32 JVM supported
    at com.adobe.air.ipa.IPAOutputStream.addInitialContent(IPAOutputStream.j
    ava:142)
    at com.adobe.air.ipa.IPAOutputStream.addFile(IPAOutputStream.java:96)
    at com.adobe.air.ADTPackager.createPackage(ADTPackager.java:47)
    at com.adobe.air.ADT.run(ADT.java:176)
    at com.adobe.air.ADT.main(ADT.java:141)
    can anyone help with the error please ?

    Hi thanks your replies I have uninstalled jre-6u20-windows-x64 again and I open the 32 bit version of IE8 and went to the java.com ran the installation checker and is recommended re-U-windows-I-gift-rv I have already downloaded this app and installed. B ut I still tried to install it and the installation process say its already installed. I ran the test applet and everything works fine.
    When I run the java file from cmd
    java -jar fai-packager.jar -package -target ipa-test -storetype pkcs12 -keystore c:/project/iphone_dev.p12 iLife.ipa c:/project/iLife-app.xml -C c:/project/ iLife.swf -C C:/project/icons . -C C:/project Default.png
    I get this error message
    'java' is not recognized as an internal or external command,
    operable program or batch file.
    The only way I can get the java to run is by installing the jre-6u20-windows-x64 update

  • Filepath probs running Java w/ DOS and Java 2 SDK

    Please help! I have been trying to get a .class file to run for the past four days, using DOS to run the file. I have tried to enter every filepath I can -think- of, and the program still will not run. I have even tried running the file on others' computers that also have a Java 2 SDK...and still cannot get the file to run. However, I know for certain that the file is correct and is able to be run....so that means that somehow I am not putting in the right filepath. I guess my question is....what's the file path?
    Here's what I was told to do...which has not worked thus far...
    My Java SDK filepath is: C:/Java2SDK1.4.0
    I was instructed to open DOS, then, to get to here:
    C:\Documents and Settings\Administrator\Desktop>I did so, and as instructed entered the filepath to the javac file inside the java sdk and after it, to put the filename with a .java extension. However, I ONLY have a class file. I don't have the .java file, nor was it ever handed to me.That filepath requested is: C:/Java2SDK1.4.0/bin/javac MathPrac.java
    I entered the filepath, so my DOS prompt looked like this before I hit the enter key:
    C:\Documents and Settings\Administrator\Desktop>C:/Java2SDK1.4.0/bin/javac MathPrac.javaI hit enter, and it gives me a LONG list of garbage. I even tried reversing the slash marks. Please help? This thing is due Monday and my instructor is refusing to return my emails. I don't want to fail this course due to an instructor being unwilling to assist a student, and a student having tried just about everything she could think of before finally coming here and asking for help.
    Would it matter if the SDK for some reason won't recognize my .java files either? I even tried doing the filepath with a file I KNOW should work...and on computers it should have worked on...and could not get it to accept my filepath.
    Any help would be very very very highly appreciated. Thanks!

    Author: philip_ross
    To run a .class file you have to use the java command (javac is the compiler which creates .class files from .java files). Try running
    C:\Java2SDK1.4.0\bin\java MathPrac
    Thank you for the suggestion, however when I attempted to run it, I got an error that said: Exception in thread "main" java.lang.NoClassDefFoundError: MathPrac
    Isn't this an error that states that the name of the file and the class name inside the file are not the same? And if so, how can I check to see if they are the same if I don't have the .java file? I did double-check my spelling, tried it four times just to be sure.
    To ChuckBing:
    Hey, thanks for the tutorial! I'll take a look at that, too. It always helps to have other resources.
    To jwenting:
    <Grin>. Duly noted, and thanks. I was trying to keep from being -too- technical in my explanation of what was going on.

  • How to run Java on Dos prompt

    HI~~
    I am new to Java and really need help.
    I have a program which requires a file as an argument and the file name should be provided as a command line argument.
    In dos prompt, how do I tell computer which file is the input file for the program to take as an argument?
    Thank you very much for helping me out.

    suppose your file in java is Hello.java
    Compile it(javac Hello.java) . u get Hello.class
    Now suppose your input file is file.txt
    So at the command prompt
    type
    c:\>java Hello file.txt
    This will cause the args[0] to be initialised to file.txt
    How to use it , u have to figure out.
    Regards
    Manoj.

  • Can't get java to run in MS-DOS

    Can someone out there, help me with a execution problem, am having in running java. I install jdk1.3 from a CD in a book(Java 2 by Andy Harris). I,am running under window98, with lots of spaces and memory. Each time I would try to execute a java module, the DOS screen would come up and then drop away. I have re-install the software. same problem, I have try run under DOS(coming out of window and restarting in DOS), same problem, so I log on the SUN web site and downloaded j2se1.4 install it try running it and still got the same problem, The screen up with data on it and just go away. What is wrong here!! [email protected]

    Yes! They are right.. We should run java in on windows, not on pure DOS. So restarting in DOS mode would not help.
    1. Start windows
    2. Click on Start -> Run
    3. Type Command and hit enter
    4. This should bring up DOS command prompt.
    5. Type "java" in at the command prompt
    6. If it gives you some suggestions about how to run java. If it says "Bad command" java.exe is not in the path. Find java.exe and append it to PATH environment variable.
    7. Once you get java working - open the command prompt as told earlier and run the java program by typing the command
    java <Main Class Name>
    8. Doing it this way would help you find out if there are any error messages.
    Your DOS window is closing because there was an error or your program finishes running. If you open DOS prompt first and then run java program it would not close the window and you will be able to see the error messages in the same DOS windows.
    Hope this helps..

  • How to read compiler msgs in DOS window?

    Hi,
    I'm just starting java programming and I'm doing the compilation in a DOS window. However it doesn't scroll. What do you guys do when the error messages go off the top of the screen?
    Steve

    Hello Steve,
    You didn't say which operating system you are running, But I suspect that you are running either Windows/95 or Windows/98. Normally the output from a command run in a DOS window goes to standard output. So when you list the files in a directory with the 'dir' command the output can be redirect with the greater than sign. As in:
    C:\>dir > dirlist.txt
    The trouble that you may encounter (if you are running Windows/95 or Windows/98) is: The error messages from javac are NOT sent to standard output (stdout), but are sent to standard error (stderr) instead. On some Windows operating systems, notably Windows/95 and Windows/98 there is no support for redirecting output from standard error. Windows/NT does provide support for redirecting output from standard error.
    Redirecting the standard error output is more difficult; COMMAND.COM doesn't give you any way to do it, but you can either get an add-on utility to do it or use a more powerful shell like 4DOS at:
    http://www.jpsoft.com/
    that does allow this as a standard feature.
    Another solution is to use an IDE such as Forte for Java. See:
    http://www.skylit.com/javamethods/faqs/scrollout.html
    for another solution.
    -Merwyn,
    Developer Technical Support,
    http://www.sun.com/developers/support.

  • DOS window

    I am new to the Java language, and am currently a student in a programming class. I am working on a small project that runs in the DOS window. I was wondering if there is a way to set the size of the DOS window from within the program?
    Any help would be greatly appreciated!

    Any help would be greatly appreciated!Remember that "DOS window" is a Microsoft construct; Java's designed for cross-platform apps. Just something to keep in mind.

  • Closing DOS window

    I have a bat that looks like this everything works
    start javaw -jar Runner.jar
    but is there anyway to make the dos window close...
    i thought javaw was supposed to run without the dos window...
    or is my dos window a result of -jar
    thanks for anyhelp
    Scott

    I did some testin on my win2000 machine, and running a batfile with the line
    start C:\jdk1.3.1_01\bin\javaw.exe -jar jarfile.jar
    gives just a quick flash of a dos window before it closes again, and my java application starts. The same works for jsdk1.4.1_01. The only way I have found to not have the dos window close automatically is to remove the "start" part of the command, in which case the window stays open as long as the application runs and then terminates. So I don't really know what causes your problem.
    When you start a bat file Windows open a dos window. When to close that again is basically up to Windows, not the programs running in it. So I think it's question of telling Windows to behave, and not the javaw command as such. I seem to remember that the properties dialog for shortcuts to dos commands in winXP have a checkbox for something like "leave dos window open", but I'm not sure.
    What does your dos window look like? - Does it "hang" on the javaw command, or do you get a new prompt you can write to?

  • How do i monitor performance in the system of a Java program in Windows XP?

    I want to record the CPU usage and Memory usage on an hourly basis programatically, for an already running java class in Windows XP environment for the purpose of testing the Java class. The recording has to be done independent of the java class.By Cpu usage and Memory usage , i need to know how much of the computer's memory and CPU has been used by the java class.
    I tried the HPROF tool available with J2SE 5.0, but it gives the details of each of the functions' usage in the program's allocated space in memory. moreover, it is not independent of the execution of the class.
    The other option is to make use of the Performance tool available in Windows Xp->Administrative tools. This is a complex procedure, and i am not sure of how to proceed in this direction.

    You can use the windows performance monitor (perfmon.exe / perfmon.msc). I don't know wther it is also included in the XP Home Edition. But this is the tool you are looking for. It can display the information in realtime but also can write to a protocoll.
    Here's a shor description of what to do (i have a german windows so i'm more or less guessing the english terms)
    - Start perfmon.msc
    - In the tree on the you can see "systemonitor" (the realtime display) and "performance protocolls and warnings"
    - open "performance protocalls and warnings", the first sub element should be something like"performance protocalls" or "performance indicator"
    - open the context menu for it and create a new protocoll settings.
    - add the information to it you are interested in and make other changes if you want
    - start the new configuration
    once you have the information you can display it it in the systemmonitor by selecting "display information from protocal" from the toolbar
    It will take some time till you know what you are doing (and most of the information the performance monitor is useless to 99% of the people). But its a quite usfull tool once you know how to use it

Maybe you are looking for

  • Return unrestricted stock to vendor

    Dear gurus, Our issue is as follows: GR is done for a line item in PO. Inspection lot is generated and this material goes to quality stock. The material is then moved to unrestricted stock. The status of the inspection lot is REL, CALC and SPCO. In s

  • How much Number of virtual processors for VMs

    Hi, there is lots more information about logical processors, cores and CPU and their definitions, on the internet. also here in this forum. In order to make sure i am not lost on internet, it is better to take experts advice like you. I have simple q

  • Image quality loss in iMovie

    When I import photos into IMovie they instantly loose focus and quality. Is there anything I can do about this?

  • Problem Joining Two Paths!

    Okay so I have Illustrator cs3 and so lets say I want to join 2 paths on a text thing so 2 letters could be joined together and then have the stroke applied to the combined letter, not the separate 2 letters. I have made some diagrams to explain my s

  • Drivers for Thinkpad T61p (Prod.no. 6458-G85) none existing???

    Ive bben looking for lastest drivers for the above mentioned notebook, but my Type G85 does not show on list. Please correct this problem ASAP as I want the latest drivers for my system, thanks!! When I search on the Product number I get this error: