Configure java not opening

JAR File Not Opening on Windows? Here’s How to Fix It

jar file not opening

JAR files, also called Java Archives files, are archives of Java class files. In a nutshell, JAR files are groups of files that can contain images, audio, visuals, etc., and can run as a single executable program when paired with the Java Runtime Environment.

They are predominantly used by Java developers for coding and programming. However, jar files refusing to open is one of the many issues that can happen while using them.

Why Does My JAR File Not Open?

Here are the possible causes for your jar file refusing to open.

  • JAR file set to open with other applications.
  • Java Runtime Environment having issues.
  • Incompatible JRE or JDK version
  • Incorrect Filename Extension

How to Fix JAR File Not Opening?

There are several methods you can use to fix JAR files not opening. However, before you begin, ensure the JAR file has the correct filename extension. To do so, go to the View tab and enable File name extensions. Make sure the JAR file has .jar at the end.

Make your way down the list of fixes to see which one works for you.

Set JRE as Default for JAR files

For the JAR files to be opened as a standalone program, you need to have the JAVA Runtime Environment. However, if the JRE is not set as the default application for opening jar files, your computer tries using different applications to open the file and fails to do so.

So, you should set the JRE as the default application for opening JAR files.

  1. Click on the specific Jar file you want to open and right-click it.
  2. Select Open with and Choose another app.
    jar file choose more
  3. Check mark Always use this app to open .jar files option.
  4. Click on More apps and Look for another app on this pc.
    look for another app on this pc

javaw

  • Navigate to C:\Program Files\Java\jre\bin. (This is the default installation path of Java. If you have installed it in another folder, go there instead. The JRE folder may also differ depending on your JRE version.)
  • Select javaw.exe and hit Open.
  • Читайте также:  Html css bubble animation

    You can also enter assoc .jar=jarfile and ftype jarfile=»C:\(path to your javaw.exe)» -jar «%1» %* command in an Elevated Command Prompt to set JRE as the default application.

    For Example:
    ftype jarfile wp-block-heading»> Use Command Prompt

    You can also easily open jar files using command lines in the Command Prompt.

    jar opening command

    1. Launch Run Utility using Windows key + R key.
    2. Enter cmd to open Command Prompt.
    3. In Command Prompt, type cd and enter the directory to your .jar file. (If the .jar file is on another drive, you need to change the selected drive by entering the driver letter.)
    4. If you don’t know how to enter the folder directory in Command Prompt, you can simply drag and drop the folder from File Explorer to Command Prompt.
    5. Enter the Java -jar command.

    If your jar file is non-executable, the above method won’t work on opening it. You would need to use a different command.

    non executable jar file opening command

    1. In Command Prompt, enter the command java -cp app.jar com..
    2. If you were not the one to create the jar file and therefore do not know the package name and class name, you can look it up on the downloaded website.

    Setup a BAT File

    Another method you can use to open .jar files is by creating a .bat file scripted to open a particular file. This method skips the normal method of opening the .jar file and helps resolves issues like this.

    1. Right-click on the empty area in the folder where your jar file is located and choose New.
    2. Select Text Document and open the document as is.
      new text document
    3. Type in Java -jar
      jar file opening bat fi;e
    4. Go to File > Save as.
    5. Make sure the Save as type option is selected as All files.
    6. Name the text document anything you want, but include a .bat extension at the end.
      save bat file

    For non-executable .jar files, you can use the same command as above to create a .bat file that opens it.

    Use Compatible Java Version

    If you have multiple Java versions and are trying to open a jar file made in a different version of Java from the one you are using to open it, the jar file may not open. While Java is supposed to be backward compatible, you may still face this issue sometimes.

    To solve this, you must define a compatible version with which the jar file should open.

    jar file create shortcut

      Right-click your jar file and tap on Create shortcut.

    shotcut target

  • Right-click the shortcut and select Properties.
  • Next to target, enter the following: “C:\(path to your compatible jdk or jre version)” -jar “C:\(path to your jarfile.jar)”
    For e.g. «C:\Program Files\Java\jre1.8.0_341\bin\javaw.exe» -jar «C:\Users\Username\Downloads\myjarfile.jar»
  • Click Apply and OK.
  • Open the shortcut.
  • You can also use this method in the Command prompt or create a bat file to open jar files.

    Reinstall JAVA Runtime Environment

    The jar files can not start as a standalone program without JRE, so JRE must be working properly to open jar files.

    If there are any errors in JAVA Runtime Environment, you can reinstall a clean new copy to nullify any issues plaguing it.

    Follow the steps below to reinstall it:

    1. Access Settings from the Start menu.
    2. Navigate to Apps > Apps & features.
    3. Locate Java and click on options button on the left.
    4. Select Uninstall and confirm Uninstall.
      uninstall java 8
    5. Download the latest Java build from its official website.
    6. Run the setup file to install Java.
      install java 8

    Run Jarfix

    Jarfix is a legit software that many Java developers use to troubleshoot issues with jar files. So, you can run Jarfix to fix issues with your jar files, including issues like jar files refusing to open.

    It is a lightweight program and doesn’t use many system resources. However, be sure to download this program from a trusted website.

    I’m a tech enthusiast, and I’ve always been troubleshooting errors by myself for years. I also like keeping up to date with the latest technology and gadgets.

    Источник

    java not working in windows 8 (Solved)

    Hi friends, well lately i signed up for anymeeting.com for organizing online meeting that’s when i came across this problem Chrome showed java is not installed in your PC. But i had installed java before so i reinstalled it but again the same message was there.

    • Install latest version of JDK
    • Latest version of JRE
    • Notice that if you are running 32 bit browser then you must have x86 bit Java installed. So all those using x64 bit OS must install x86 bit JRE if they are using 32 bit browser as in my case this was the problem.
    • Both x64 and x86 JAVA can be installed simultaneously. So better install both! (i have both installed)
    • Now, Add the path of java compiler to the environment variable as shown below:
    1. Open Advance System Settings > Environment Variables> System Variables.
    2. Click New(if it doesn’t exist else Edit) : CLASSPATH (variable name), %JAVA_HOME%\jre\lib; (variable value),
    3. Click New : JAVA_HOME (name), C:\Program Files\Java\jdk1.7.0 (value).
    4. Click Edit in Path: in value add: %JAVA_HOME%\bin;
    5. Save and exit.

    Note ‘ ; ‘ separates one path with other just like ‘ . ‘ denotes the end of a line.’

    Hope this solves your problem. Enjoy java in windows 8.

    environment

    path variable

    Like this:

    2 responses to “ java not working in windows 8 (Solved) ”

    Java Verify failure unable to Configure Java Control Panel does not open ( Fix : )
    this is a regular ( windows 7 bug related ) problem after successful installation of Java ( jre ) and fresh installation of Windows7 64bit or 32bit on my laptop or desktop. what worked perfectly for me was setting COMPATIBILITYMODE=WINDOWSNT to make windows launch the JP2LAUNCHER.EXE and JAVAW.EXE files properly.
    jp2launcher.exe windowsNT compatibility solves Java Verify failure problem at https://www.java.com/en/download/installed.jsp
    javaw.exe windowsNT compatibility solves unable to open or Configure Java Control Panel problem. * search for JAVAW.EXE inside c:\program files\java\….\bin
    or c:\program files(x86)\java\…..\bin\
    * right-click mouse on JAVAW application icon logo
    * click PROPERTIES
    * click COMPATIBILITY
    * tick the checkbox at COMPATIBILITY MODE
    * choose WINDOWS NT service pack
    * click APPLY or click OK
    Now, the Configure Java Control Panel will start opening and working. * search for JP2LAUNCHER.EXE inside c:\program files\java\….\bin
    or c:\program files(x86)\java\…..\bin\
    * right-click mouse on JP2LAUNCHER
    * click PROPERTIES
    * click COMPATIBILITY
    * tick the checkbox at COMPATIBILITY MODE
    * choose WINDOWS NT service pack
    * click APPLY or click OK
    Now, the Verify Java will be successful at https://www.java.com/en/download/installed.jsp if we find 2 or 3 versions of JP2LAUNCHER and JAVAW when we search, then we must repeat the above for all of them. in the Configure Java Control Panel Advanced tab we can set “Do not check” certificate revocation and disable security verification. and in the Security tab we may Edit Site List… for the Exception Site List ( add URLs to unblock sites )

    Leave a Reply Cancel reply

    Microsoft Student Partner.

    quote

    New Posts

    Most Viewed Posts

    Источник

    Оцените статью