Exe files java eclipse

Creating exe for my java Application in eclipse? [duplicate]

Actually how to create an exe file instead of jar file, that means just by double clicking that exe file, should run my app in any machine. When I did something like this I am getting a jar instead of exe file, When I run the jar in command prompt using «java -jar sample.jar» then I am getting class not found exception».

Creating exe for my java Application in eclipse? [duplicate]

Possible Duplicate:
How can I convert my java program to an .exe file ?

how to create the exe file of my application in eclipse? please mention the steps to follow.

If you’re just wondering how to run your application outside the Eclipse IDE, then you don’t need an exe. Look for the «Export JAR» option in the menu.

If the export is done properly (with a MANIFEST generated), you should then be able to run the jar file by double-clicking on it, or from the commandline with «java -JAR fileNAME.jar». Note that this is a platform-independent format.

launch4j:You can use Launch4J application to covert jar to exe.

Steps: 1) Create .JAR File for your application using your IDE with proper MANIFEST. 2) Run Launch4j and convert .jar to .exe

Creating an executable JAR file in Eclipse, 7 When you go to Export -> Java -> JAR File, click next to get to the second page of the wizard. There, you can Save the description of this JAR in the …

How to Create an Executable File in Java Eclipse

Create an Executable File in Eclipse To support more videos from DJ Oamen, visit POamen Paypal https://www.paypal.me/POamen To Become a Channel member …

How to create an Executable Jar File in Eclipse with a

How to create an exe file in java

Hi I want to create an exe file for my java app.

I tried with some third party softwares JEXECreator, successfully created the exe file and its working fine in my system, when I tried with another machine, it’s not working. I got the following error

 * The error occurred while running the application. The exit code is 0x10000223. * Contact the vendor of the application for troubleshooting. java.lang.ClassNotFoundException: com.sample.SampleMain at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.ucware.JEXEClassLoader.run(Unknown Source) at com.ucware.JEXEClassLoader.main(Unknown Source) ************************************** 

I know there is something wrong with the classpath which I set.

Читайте также:  Php поиск изображения в изображении

Actually I want to create the exe file myself without using any third party software.

I found the steps in lot of sites

Created the manifest file named Sample.mft with following contents

 Manifest-Version: 1.0 Main-Class: Class-path: 

In this I have some doubts,

  1. How the Main-Class should be added, with the full package name (com.sample.SampleMain) or the class name alone (SampleMain) or with the extension (SampleMain.class)
  2. How the class-path should be added, I have 4 java classes and 2 jars in my project. How to add all these in the class path, and do I need to add the java jdk in classpath.
  3. Where the manifest file should be saved
  4. What should be the manifest file extension (mf or mft)
  5. In command prompt from which directory I should create the exe file (from my project folder or src folder or the folder which contains all the java classes)
  6. What’s the syntax should be used while creating jar in command prompt

(jar cmf Sample.mf Sample.jar Sample1.class Sample2.class Sample3.class Sample4.class jar1.jar jar2.jar) like this or (jar cvfm Sample.jar sample.mf *.class)

When I did something like this I am getting a jar instead of exe file, When I run the jar in command prompt using «java -jar sample.jar» then I am getting class not found exception».

Actually how to create an exe file instead of jar file, that means just by double clicking that exe file, should run my app in any machine.

Can anyone help me to do this?

I use the Ant tool under Eclipse IDE to work with InnoSetup and Launch4J to create the EXE and its installer which it also manages the classpath.

http://www.eteks.com/tips/tipCreationExe.html (in French)

Can’t speak for JEXECreator, but I can recommend JSmooth (http://jsmooth.sourceforge.net/). I’ve successfully used it for several projects (e.g. this SWT based Java app).

Personally, I like JSmooth. That is just wrapping. This means it is still a Java application. When executing the exe, it will unpack the jar to a temporary folder and then execute it with javaw -jar .

A second option is gcj. But that is absolutely a bad choice. That doesn’t wrap the jar in an exe, but it really compiles it to native system code. But this slows down your application very much. You can check some results of my timing on this topic.

I had some positive experience with excelsior jet. Unlike gcj it actually works and execution times are faster than that of an executed .jar file. The downside is that it’s not for free.

Java — How to make executable JAR app in Eclipse?, You could create a new folder like: images inside of your project and put your icons in there. You will use this way to set icon on your menu: …

Generating an executable file from Eclipse

I’ve made a program to help me out with some stuff, but every time I need it, I open Eclipse and Run it.

Is it possible to create an executable file so I won’t need to open Eclipse every time? The commands I use is basically System.out.println() and Scanner to read what I type.

Читайте также:  Html select option onchange

Right-click on project.
Export as Runnable JAR.

File -> Export -> Java -> Runnable JAR File

You’ll have to choose the main class that you want it to run. This will allow you to double-click on the JAR, and have it run that main.

You can File > Export > JAR file to export your project as a jar and put the java command to run the jar on a windows batch file. Alternatively you can File > Export > Runnable JAR file

You can either create an executable jar file (using eclipse, or a build tool like «ant» or «maven») or you can also create a «real» Windows-Executable File (which you can also give to customers/friends).

I am using JSmooth a lot ( http://jsmooth.sourceforge.net/ ) — this builds a wrapper around your jar-files and can help the user with downloading and installing an appropriate java virtual machine version.

Probably the executable jar (see answer of Serplat) file is what you need 🙂

Java — Generating an executable file from Eclipse, File -> Export -> Java -> Runnable JAR File You’ll have to choose the main class that you want it to run. This will allow you to double-click on the JAR, …

How to create executable (.exe) file for any platform using Sikuli-script + Java + Eclips IDE

I have create java application using sikuli-script(latest version 1.0.1) .

I added the sikuli-script.jar to the Referenced Libraries (I configured using this answer Answer Link)

java code folder structure —>

package com.example.sikuli; import org.sikuli.script.*; import java.util.concurrent.TimeUnit; public class TestSikuli < public static void main(String[] args) < Screen s = new Screen(); App app = new App("C:/Program Files/Mozilla Firefox/firefox.exe");//firefox path try< app.focus(); TimeUnit.SECONDS.sleep(2); s.click("imgs/1391152193781.png", 0);//url bar image s.type(null, "http://www.google.lk", 0); s.click("imgs/1391152289812.png", 0);//click search image >catch(FindFailed e) < e.printStackTrace(); >> > 

After that i set the the Run Configutrtion such as PATH and SIKULI_HOME

Next I run the code it’s working properly.

Then I create .exe using launch4j and according to this site instructions —> How to Create an Executable File from Eclipse

After that i run the .exe file from command prompt then following errors occurred. Please help me.

[error] ResourceLoaderBasic: check: libs dir is empty, has wrong content or is outdated [action] ResourceLoaderBasic: check: Please wait! Trying to extract libs to: C:\Documents and Settings\Dell\SikuliX\libs [error] ResourceLoaderBasic: loadLib: Fatal Error 109: not found: C:\Documents and Settings\Dell\SikuliX\libs\VisionProxy.dll [error] Terminating SikuliX after a fatal error(109)! Sorry, but it makes no sense to continue! If you do not have any idea about the error cause or solution, run againwith a Debug level of 3. You might paste the output to the Q&A board. 

—1. when programming in Java using Sikuli, you should always use sikuli-java.jar (sikuli-ide.jar contains much stuff not needed here).

—2. Set a JVM option -Dsikuli.Debug=3 when running the exe to get more details about what’s going on. I guess the problem is, that for some reason the export of the native libs does not work in the context of a launch4J exe (I did not test this yet).

Читайте также:  Echo function name php

—3. always use the latest version (1.1.1 in this case, still nightly but pre-final 😉 http://sikulix.com

Java — Eclipse: How to build an executable jar with, Now include the mysql-connector-java-5.1.28-bin.jar from Oracle which enables us to write Java to connect to the MySQL database. Do this by …

Источник

Как создать исполняемый файл в Eclipse

28-05-2021, 01:30

Java

524

0

После завершения проекта в Eclipse ваша следующая цель будет заключаться в создании исполняемой версии проекта. Наиболее простой и стандартный процесс запуска Java-проекта является запуск исполняемого файла (.EXE). В этом руководстве мы рассмотрим, как превратить типичный файл . jar в исполняемый файл!

Экспорт из Eclipse

Щелкните правой кнопкой мыши по проекту и нажмите кнопку «Refresh» (Обновить). Или же вы можете щелкнуть правой кнопкой и нажать F5 на клавиатуре. Это делается для того, чтобы весь ваш код находился в актуальном состоянии и не конфликтовал при попытке экспорта.

  • Во-вторых, выберите «Export destination» (Место экспорта) с помощью кнопки «Browse. » (Обзор) или вручную, вводя месторасположение.
  • Наконец, обеспечьте выбор переключателя «Extract required libraries into generated JAR»(Извлечь необходимые библиотеки в созданные JAR) «. Не волнуйтесь об остальной части меню. Нажмите кнопку «Finish» (Готово), когда будете довольны своим выбором.

Создание иконки

Найдите или создайте изображение, которое будет выглядеть уместным с вашей программой в виде значка. Помните, что иконка — это картинка, которую пользователь будет нажимать всякий раз, когда будут загружать программу; так что она будет видна часто! Попробуйте подобрать запоминающееся или наглядное изображение. Размер изображения должен быть 256×256 для того, чтобы можно было работать с ним должным образом как с иконкой.

Перейдите на сайт convertico.com. Это бесплатный сайт, который преобразует обычные файлы изображений (.png, .jpg) ) в удобный файл значка (.ico).

Или введите URL, или просмотрите файлы вашего компьютера, чтобы найти изображение, которое вы ранее выбрали. Нажмите кнопку “Go”.

Создание исполняемого файла

Скачайте launch4j. предназначенная для компиляции всех ваших ресурсов в один исполняемый файл. Вы можете скачать launch4j с сайта http://sourceforge.net/projects/launch4j/files/launch4j-3/3.1.0-beta1/.

В первом текстовом поле введите или выберите с помощью просмотра место, где исполняемый файл хотите сохранить. Убедитесь, что имя файла имеет “.exe” в конце названия!

Во втором текстовом поле введите или выберите с помощью просмотра файл .jar, ранее экспортированного из Eclipse.

В четвертом текстовом поле с надписью “Icon:”, введите или выберите с помощью просмотра “файл .ico”, который мы ранее преобразовали. Это не является обязательным, и если его оставить пустым, ваша ОС вернется к своему значку по умолчанию исполняемого файла.

На вкладке “JRE”tв верхней части выберите “Min JRE version” и введите “1.4.0”. Это гарантирует, что пользователи имеют нужную версию Java для использования вашей программы. Вы можете изменить это, но 1.4.0 является безопасной версией.

Дайте файлу .xm lсоответствующее имя и нажмите «Save». Файл .xml является стандартным, не волнуйтесь об этом. Ваш исполняемый файл теперь будет создан!

Советы

  • Убедитесь, что размер изображения256×256, и что вы выбираете файл.ico вlaunch4j.
  • Убедитесь, что все ваши расширения — правильные (.exe, .jar, .ico, .xml).

Источник

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