As such, once Jarx is installed, you can then open a JAR file like any other. You can also run it from Command Prompt.
Then input the following command, but replace sample. Alternatively, you can unpackage the JAR file. You can do this to see what files are contained within it or if the JAR file isn't designed to be an executable file. To unpackage a JAR, you need a program that can extract compressed files. Windows includes functionality for this, but you can also use file extraction software like 7-Zip or WinRAR to get the job done. Open the JAR file within the software, and you can browse all the folders and files within it.
You can also extract the JAR if you want to use or inspect the individual files further. Alternatively, you can use an online extractor if you don't want to download an extracting program.
A good choice is Archive Extractor because it's easy to use and, most importantly, supports JAR files not all online extractors do. Simply upload your JAR, and it will show you the contents of the file within a tree structure. Click a folder to open or expand it and a file to download it individually. Finally, if your computer is having problems recognizing an executable JAR file, you can right-click the file, click Rename and then append the.
ZIP file extension. This works because the file types are so closely linked. Are you sure you need to make a JAR file?
Remember, they serve a specific purpose: bundling files together to be used as a Java application. If that's what you need to do, head over to Oracle's packaging programs in JAR files documentation.
Double click it and go to the end, put a semicolon and paste your path, apply and ok. It should run now. In order to download it click on the following link. Do not forget to check "Accept License Agreement", before you choose the version you want to download. Install the file that is going to be downloaded.
During the installation, pay attention, because you have to keep the installation path. As soon as you have defined the Environment Variables, you can go to command prompt cdm and run from every path your preferred "java.
Your command line can now recognize your "java. Then the "System" window will appear and you have to click on "Advanced system settings". As a consequence "System properties" window shows. Select the "Advanced" tab and click on "Environment Variables" button. You can now define the aforementioned variables and you're done. You must create a manifest file and specify your class that has the main method.
Copy this code to a. Then whenever you double click, the jar file will be executed. Hope this helps. In Netbeans please delete current you create the jar file and on the project explore of Netbeans please clean and build 2 or 3 times and right the project folder in project explore and build the jar file.
Just uninstall the current version of Java , download an older one, then uninstall the older and install the latest again. How it works: Java 's registry keys were messed up, and when you install the older version they get fixed. If the intention of the question is to view the contents of the JAR file, then the following java command would help.. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 8 years ago. Active 1 year, 2 months ago. Viewed k times. I can't open or run my.
Improve this question. Possible duplicate here — Sionnach Just follow the steps outlined in the top answer. It also doesnt matter if you have jdk or jre, both contain a runtime environment. No account yet? Create an account. Edit this Article. We use cookies to make wikiHow great. By using our site, you agree to our cookie policy. Cookie Settings.
Learn why people trust wikiHow. Download Article Explore this Article methods. Tips and Warnings. Related Articles. Article Summary. Method 1. Install Java on your computer if it isn't installed.
You can't run JAR files without Java installed on your computer. You may have to restart your computer for Java to be fully implemented. Double-click the JAR file. If it's executable and you have Java installed, it should open. If it doesn't open, proceed to the next step. You may see a pop-up window asking which program you want to use to open the file.
Make sure your JAR file is an executable file. JAR files that you download in order to set up programs are different from "library" JAR files, which store data that a program running Java can use.
For example, many of the JAR files in a program's data folders are not executable files. If you downloaded your JAR file from online, make sure you clicked the Windows version of the file rather than the Mac version. Update Java. If your JAR file produces an error when you double-click it, you may need to update Java.
Double-click your JAR file again. If it doesn't open this time, the file you're trying to open isn't executable and thus cannot be "run" in the traditional sense. Method 2. Try double-clicking your JAR file. If double-clicking the file doesn't open it, proceed to the next step.
0コメント