Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how do i open a .jar file with a run.bat script

  1. #1
    Junior Member
    Join Date
    Sep 2022
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how do i open a .jar file with a run.bat script

    So im trying to open a .jar file called optifine with a run.bat by using the following code in windows 11

    start javaw -OptiFine_1.19.2_HD_U_H9 (1).jar

    but after that it responds with an error of:

    Error: could not create the java virtual machine.
    Error: A fatal exeption has occured. program will exit.

    how do i manage it so that i can open the .jar file with a .bat code . or just open it in any way and also future .jar files that may come up

    I just downloaded the latest version of java too, deleted it and downloaded it back up again, and reset my laptop multiple times, yet i cant manage to open the .jar file, i just need some answers

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,929
    Thanks
    59
    Thanked 2,697 Times in 2,647 Posts

    Default Re: how do i open a .jar file with a run.bat script

    What happens if you enter the command: java -version in a command prompt window?
    Why are you trying to use javaw instead of java?

    Note: the java commandline option to use a jar file is: -jar
    java -jar TheJarFilename.jar
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Generate script based on excel file
    By moaw in forum The Cafe
    Replies: 3
    Last Post: June 26th, 2019, 10:36 AM
  2. Replies: 2
    Last Post: July 9th, 2018, 07:02 AM
  3. How to give refrence of java script file and css file in jasp page????
    By ambblr108 in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: August 14th, 2014, 02:35 AM
  4. How to give refrence of java script file and css file in jasp page????
    By ambblr108 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: August 14th, 2014, 01:18 AM
  5. modification to core java file: javax.script.AbstractScriptEngine
    By amughost in forum Java Theory & Questions
    Replies: 0
    Last Post: June 13th, 2012, 11:37 AM

Tags for this Thread