Results 1 to 16 of 16
  1. #1
    degrotepeter is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default .bat flashes problem

    I am a total newb regarding java, but I have downloaded this .bat file.

    which contains this piece of code:

    "java -jar FingerPlayServer.jar %1 %2"

    But whenever I open it it just flashes a dos window quickly and goes away doing nothing.

    Can anyone help me out with this?

    I am running a windows 7 ultimate machine (64bit).

    Thanks in advance,

    Peter

  2. #2
    Spike_CT is offline Member
    Join Date
    Jan 2010
    Posts
    14
    Rep Power
    0

    Default

    Probably the program in the JAR ended very fast en closed the console.

    Try to open you're bat in a commandpromt. This way you're prompt will not close instantly and you can view the messages printed by the program.

  3. #3
    degrotepeter is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    Now it says something like this:

    (Ill try to translate it from dutch)

    Java is not recognized as an internal or external command, program or batchfile.

    So I dont know what to do at all now, the program should work...

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Are you passing any command line parameters into the batch file? In other words, how specifically are you calling the batch file?

  5. #5
    degrotepeter is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    I dont know, I didnt make it.

    The program should tell me which port I have to connect to on my phone in order to use a program which sends midi messages.

    all the code I can find in the bat is:
    java -jar FingerPlayServer.jar %1 %2

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by degrotepeter View Post
    Now it says something like this:

    (Ill try to translate it from dutch)

    Java is not recognized as an internal or external command, program or batchfile.

    So I dont know what to do at all now, the program should work...
    Ah, do you have Java installed on this computer? And if you do, you'll have to make sure that Java's bin directory is on your system's path. For instance on my wife's computer, the Java bin directory is here:

    C:\Program Files (x86)\Java\jre1.6.0_07\bin

    And my system's path contains this line within it.

  7. #7
    degrotepeter is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    Yeah I got java installed, I knew I had to have java (I already had it) in order to run the jar file.

    And yep it is there,

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by degrotepeter View Post
    I dont know, I didnt make it.
    I'm not asking how it's made or what the batch file contains but rather how you call it. Is this on Windows (I thought you said it was), and are you calling the batch file from a Window's short-cut? If so, the short cut needs to have at least two parameters after the batch file name.

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by degrotepeter View Post
    Yeah I got java installed, I knew I had to have java (I already had it) in order to run the jar file.

    And yep it is there,
    and you've checked the system's path?

  10. #10
    degrotepeter is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    Yep the path is correct,

    I got the files in this directory:

    C:\fingerplay

    Just for the easy of entering this line in prompts.

  11. #11
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by degrotepeter View Post
    Yep the path is correct,
    So are you saying that you're no longer getting this error message:
    Java is not recognized as an internal or external command, program or batchfile.
    ?

    Because if the path is in fact correct and contains a reference to Java's bin directory, you will have solved this. If not, then please show us where your bin file is, and also show us your system's path string.

  12. #12
    degrotepeter is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    The path to my java bin is:
    C:\Program Files (x86)\Java\jre6\bin

    The path to the program is:

    C:\fingerplay

  13. #13
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by degrotepeter View Post
    The path to my java bin is:
    C:\Program Files (x86)\Java\jre6\bin
    What about your system's path String? What is it? Are you familiar the system path and other environment variables that we're discussing here?

    The path to the program is:

    C:\fingerplay
    For the moment, this isn't important.
    Last edited by Fubarable; 10-03-2010 at 07:05 PM.

  14. #14
    degrotepeter is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    Do you mean the environment variables?

    The environment variable is:
    C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip

    And that file is there.

    Or do you mean something else, in that case I dont know...

  15. #15
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by degrotepeter View Post
    Do you mean the environment variables?

    The environment variable is:
    C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
    No, I mean your system path for your Windows OS. I'm not familiar with Windows 7, but with Vista, you would go into the control panel, click on System and Maintenance, click on System, and then click on Advanced System Settings. Then you'd see a button called Environment Variables, and if you click the button, you'd be able to see and change the system's path String. For example on my computer, the path is:

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;C:\Program Files (x86)\CyberLink\Power2Go;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin;%DERBY_HOME%\bin;C:\Program Files (x86)\Java\jdk1.6.0_13\bin;C:\Program Files (x86)\QuickTime\QTSystem\

    and you can see that C:\Program Files (x86)\Java\jdk1.6.0_13\bin; is one of the strings buried in this path. You may need to find the path string by a different method, and your Windows help system should show you how. Either search on path or on environment variables for info on how to do it on your system. The key is once you find the path String, you want to add the java bin directory to it. Note that all strings in the path need to be separated by a semicolon.

    Luck!

  16. #16
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by degrotepeter View Post
    C:\Program Files (x86)\Java\jre6\bin

    add the above path to your PATH variable of your system, so when you type

    java -version

    you get something like


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •