How to Open a JAR File on Android
Your Android device can run Java games and apps, but it isn’t designed to do so, and hence you don’t find any Java emulators on the Play Store to run jar files on Android devices.
However, if you must open a jar file on your Android device, there are a few third-party apps you can install to your Android device to run java apps & games. But know that you need root access on your Android device to run Java.
In our tests, we found the JBED app to be the best of the lot to open jar files on Android devices. It’s basically a JAVA emulator which you can use to install JAR/JAD/JAVA/J2ME/MIDP apps & games on your Android device.
[icon name=”download” unprefixed_class=””] Download JBED (.apk) [icon name=”download” unprefixed_class=””] Download libjbedvm.so
Instructions
- Download both the JBED.apk and libjbedvm.so files to your device from the download links above.
- Using File manager app with root access, place the libjbedvm.so file to system/lib directory on your Android device.
- Install the JBED.apk file on your device. BUT DON’T OPEN IT YET!
- Reboot your device.
- Open JBED app » open menu and select SD Card » select the jar/jad file you want to open and install it.
- Now open the java app your installed.
That’s all. Hope you’re able to open jar files on Android device following the guide above.
Shivam Malani
Shivam is our resident designer and web developer who also enjoys writing. He loves to meditate, drive on the freeways and hunt for snipers during his Call Of Duty playtime. Email: [email protected]
Источник
Как запустить jar на android
Многие обладатели мобильных устройств, функционирующих под управлением операционной системы Android, имеют сложности с тем, как запустить jar файлы на Android смартфоне. Данный факт не вызывает удивления, поскольку в ОС Android изначально нет встроенного механизма, поддерживающего программное обеспечение Java. Чтобы запустить jar на Android, нужно инсталлировать специальный эмулятор, который называется Java Me. Существует множество подобных программ для Android, обладающих своими преимуществами и недостатками.
1. Смартфон с доступом в интернет.
2. Программа-эмулятор J2ME Runner.
Инструкция – как запустить jar файл на Android
1. Приложение для Android имеет открытый исходный код и распространяется на бесплатной основе. Найти софт можно в интернете. После установки утилиты ее легко распознает любой файловый менеджер (файл с расширением .apk). Помните, что эмулятор не увидит программы для Android, расположенные на sd-карте телефона, поэтому нужно снова их закачать.
2. Использование
Когда вы будете скачивать нужный jar-файл, документ попросит выбрать приложение, предназначенное для его загрузки. Здесь нам и пригодится эмулятор J2ME. Основная его задача заключается в загрузке и инсталляции конкретной программы. Вследствие чего ярлык установленного софта отобразится на рабочем столе дисплея устройства.
3.Примечание
Обратите внимание на основной недостаток эмулятора – в процессе запуска основная проблема заключается в большом количестве документов с расширением .jar. В остальном софт прост в эксплуатации.
Советуем воспользоваться антивирусом, чтобы при скачивании программного обеспечения надежно защитить компьютер и телефон. Существуют и другие эмуляторы для установки и запуска jar файлов. К недостаткам некоторых из них относят более сложную процедуру инсталляции. Как правило, трудности связаны с тем, чтобы получить root-права доступа. Этот процесс в некоторой мере зависит от определенной модели гаджета. Поскольку каждый смартфон имеет свои отличительные черты.
Внимательно работайте с root-доступом. Выполняйте те операции, в которых полностью уверены. В противном случае вы рискуете серьезно навредить мобильному устройству.
Источник
Как открыть файл JAR на Android
Ваше устройство Android может запускать игры и приложения Java, но оно не предназначено для этого, и, следовательно, вы не найдете эмуляторов Java в Play Store для запуска файлов jar на устройствах Android.
Однако, если вам необходимо открыть файл jar на своем устройстве Android, есть несколько сторонних приложений, которые вы можете установить на свое устройство Android для запуска приложений Java и игр. Но знай, что вам нужен root-доступ на вашем Android-устройстве для запуска Java.
В наших тестах мы обнаружили, что приложение JBED является лучшим из всех для открытия файлов jar на устройствах Android. По сути, это эмулятор JAVA, который вы можете использовать для установки приложений и игр JAR / JAD / JAVA / J2ME / MIDP на ваше устройство Android.
[icon name=”download” unprefixed_class=””] Скачать JBED (.apk)
[icon name=”download” unprefixed_class=””] Скачать libjbedvm.so
инструкции
- Загрузите как JBED.apk а также libjbedvm.so файлы на ваше устройство по ссылкам для скачивания выше.
- Используя приложение файлового менеджера с root-доступом, поместите файл libjbedvm.so в каталог system / lib на вашем устройстве Android.
- Установите файл JBED.apk на вашем устройстве. НО ЕЩЕ НЕ ОТКРЫВАЙТЕ!
- Перезагрузите ваше устройство.
- Откройте приложение JBED »откройте меню и выберите SD-карта» выберите файл jar / jad, который хотите открыть, и установите его.
- Теперь откройте установленное вами приложение Java.
Это все. Надеюсь, вы сможете открывать файлы jar на устройстве Android, следуя приведенному выше руководству.
Источник
Creating a JAR File
The basic format of the command for creating a JAR file is:
The options and arguments used in this command are:
- The c option indicates that you want to create a JAR file.
- The f option indicates that you want the output to go to a file rather than to stdout.
- jar-file is the name that you want the resulting JAR file to have. You can use any filename for a JAR file. By convention, JAR filenames are given a .jar extension, though this is not required.
- The input-file(s) argument is a space-separated list of one or more files that you want to include in your JAR file. The input-file(s) argument can contain the wildcard * symbol. If any of the «input-files» are directories, the contents of those directories are added to the JAR archive recursively.
The c and f options can appear in either order, but there must not be any space between them.
This command will generate a compressed JAR file and place it in the current directory. The command will also generate a default manifest file for the JAR archive.
The metadata in the JAR file, such as the entry names, comments, and contents of the manifest, must be encoded in UTF8.
You can add any of these additional options to the cf options of the basic command:
Option | Description |
---|---|
v | Produces verbose output on stdout while the JAR file is being built. The verbose output tells you the name of each file as it’s added to the JAR file. |
0 (zero) | Indicates that you don’t want the JAR file to be compressed. |
M | Indicates that the default manifest file should not be produced. |
m | Used to include manifest information from an existing manifest file. The format for using this option is: |
-C | To change directories during execution of the command. See below for an example. |
When you create a JAR file, the time of creation is stored in the JAR file. Therefore, even if the contents of the JAR file do not change, when you create a JAR file multiple times, the resulting files are not exactly identical. You should be aware of this when you are using JAR files in a build environment. It is recommended that you use versioning information in the manifest file, rather than creation time, to control versions of a JAR file. See the Setting Package Version Information section.
An Example
Let us look at an example. A simple TicTacToe applet. You can see the source code of this applet by downloading the JDK Demos and Samples bundle from Java SE Downloads. This demo contains class files, audio files, and images having this structure:
TicTacToe folder Hierarchy
The audio and images subdirectories contain sound files and GIF images used by the applet.
You can obtain all these files from jar/examples directory when you download the entire Tutorial online. To package this demo into a single JAR file named TicTacToe.jar, you would run this command from inside the TicTacToe directory:
The audio and images arguments represent directories, so the Jar tool will recursively place them and their contents in the JAR file. The generated JAR file TicTacToe.jar will be placed in the current directory. Because the command used the v option for verbose output, you would see something similar to this output when you run the command:
You can see from this output that the JAR file TicTacToe.jar is compressed. The Jar tool compresses files by default. You can turn off the compression feature by using the 0 (zero) option, so that the command would look like:
You might want to avoid compression, for example, to increase the speed with which a JAR file could be loaded by a browser. Uncompressed JAR files can generally be loaded more quickly than compressed files because the need to decompress the files during loading is eliminated. However, there is a tradeoff in that download time over a network may be longer for larger, uncompressed files.
The Jar tool will accept arguments that use the wildcard * symbol. As long as there weren’t any unwanted files in the TicTacToe directory, you could have used this alternative command to construct the JAR file:
Though the verbose output doesn’t indicate it, the Jar tool automatically adds a manifest file to the JAR archive with path name META-INF/MANIFEST.MF. See the Working with Manifest Files: The Basics section for information about manifest files.
In the above example, the files in the archive retained their relative path names and directory structure. The Jar tool provides the -C option that you can use to create a JAR file in which the relative paths of the archived files are not preserved. It’s modeled after TAR’s -C option.
As an example, suppose you wanted to put audio files and gif images used by the TicTacToe demo into a JAR file, and that you wanted all the files to be on the top level, with no directory hierarchy. You could accomplish that by issuing this command from the parent directory of the images and audio directories:
The -C images part of this command directs the Jar tool to go to the images directory, and the . following -C images directs the Jar tool to archive all the contents of that directory. The -C audio . part of the command then does the same with the audio directory. The resulting JAR file would have this table of contents:
By contrast, suppose that you used a command that did not employ the -C option:
The resulting JAR file would have this table of contents:
Источник
Android java jar file
Сегодня речь пойдет о том, как запускать полноценные java-приложения на устройствах под управлением Android, для чего это может быть необходимо и какие приложения будут актуальны для мобильной платформы. Полноценные приложения это те, для запуска которых не хватает возможностей Dalvik VM. Таким приложениям необходима JRE. Далее поговорим о том, как ее установить и работать с ней.
Установка
Для установки JRE требуется установить какой-нибудь terminal и busybox. Последний пакет требует наличия root-прав. О том, как получить root-права для Android можно прочесть здесь. Сама JRE не требует root. Скачать приложение можно из основного репозитория альтернативного маркета F-droid, либо самостоятельно собрать пакет из исходного кода. Сам процесс установки тривиален, все как и для любого другого apk-файла. После запуска программы она предложит докачать дополнительные библиотеки (glibc, awt и т.д.). Кстати, все зависимости, вроде терминала и busybox программа также способна скачать самостоятельно. Разумеется, для максимальной совместимости необходимо отметить все элементы.
Использование
Для запуска jar-архива нажимаем на кнопку «run jar file», программа запрашивает доступ к файловой системе. Выбираем программу, с помощью которой указываем файл для запуска.
Лично я рекомендую Total Commander в качестве файлового менеджера. Он бесплатен и очень удобен, плюс есть поддержка плагинов.
Так вот, после выбора файла открывается окно терминала, который запускает java-машину и передает ей путь к выбранному jar-файлу. Далее, в зависимости от программы, работа будет через терминал, либо запустится отрисовка интерфейса. Очень легко и удобно, не правда ли? К сожалению, есть небольшой косметический недочет, при первом запуске в терминале криво отображается путь к исполняемому файлу java и передаваемым аргументам.
Но на работу это не влияет, а при повторном запуске команды она отображается правильно.
На рисунке результат запуска небольшого тестового проекта. Его код приведен ниже
Что касается GUI-приложений, то мой AExplorer отказался запускаться, ссылаясь на отсутствие поддержки в текущих версиях.
Тем не менее, «полноценные» консольные приложения работают без особых проблем.
Итоги
Не смотря на очевидные недоработки в запуске оконных приложений, на сегодняшний день уже возможно запускать консольные java-приложения. Они работают без каких-либо проблем, если не используют каких-либо дополнительных нативных библиотек. В таком случае необходимо сначала собрать библиотеку на устройстве, а уже потом запускать jar-архив. Тем не менее, java installer на сегодняшний день вполне жизнеспособный проект.
Источник