I want to turn my .jar file into an .exe file on my macOS. I use launch4j, but the 'JRE paths' configuration is always wrong, and it always says
103 RCDATA BEGIN "This application requires a Java Runtime Environment\0" END
104 RCDATA BEGIN "The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.\0" END
net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/usr/local/Cellar/launch4j/3.50/libexec/bin/windres": error=2, No such file or directory
I've tried%JAVA_HOME% $JAVA_HOME /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/ /Library/Java/JavaVirtualMachines/temurin-11.jdk.etc, none of these work.
Could you tell me what's wrong?
The launch4j is version 3.5.
added:
I add the file windres in /usr/local/Cellar/launch4j/3.50/libexec/bin/windres, but it says net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/usr/local/Cellar/launch4j/3.50/libexec/bin/windres": error=13, Permission denied
Related
A few weeks ago I installed Java, set JAVA_HOME on my computer and the JDK in my IDE. Everything worked fine, until today. I got an error when starting my IDE, "Cannot run program" and the path I installed my Java. I checked the path and it's really not there, also "java version" and "java home" commands from the command prompt now can't find it.
I installed it again, and now after a couple of hours the bin folder disappeared!
Adding more info: I'm using java 1.8.0.261
Full error:
Cannot run program "C:\Program Files\Java\jdk1.8.0_261\bin\java.exe" (in directory "C:\Users[my_username]\AppData\Local\JetBrains\IdeaIC2021.2\compile-server"): CreateProcess error=2, The system cannot find the file specified
I'm trying to import a project into Intellij using Solus and I'm having a bit of an issue with Gradle being able to find the correct Java location. I get this error when I try to sync:
Cause: error=2, No such file or directory
Which, when going through Intellij's logs, is caused by this:
Caused by: java.io.IOException: Cannot run program "/opt/jdk1.8.0_221/bin/java" (in directory "/home/me"): error=2, No such file or directory
For some reason Gradle is looking in my home directory for my $JAVA_HOME location, and I have no idea why or how to point it to the right destination. I have a symlink between /opt/jdk1.8.0_221 and usr/bin/java, and when I run echo $JAVA_HOME I get this output:
~ $ echo $JAVA_HOME
/usr/bin/java
Is there something I'm doing incorrectly with setting up Java on Solus? Or am I missing some Gradle setting?
Not a true solution, but I just ended up reinstalling Solus and using SDKMan for managing my java installs. Everything is okay now!
I've created a simple GUI application using swing. I wanted to make a .exe file for the same so that I could use it on windows. I have used launch4j for this purpose earlier. But, this time, I was unable to wrap the generated jar file into a .exe file. Following is the complete log message that I'm getting:
Compiling resources
Generated resource file...
LANGUAGE 0, 1
2 RCDATA BEGIN "1.8.0_131\0" END
18 RCDATA BEGIN "1\0" END
30 RCDATA BEGIN "2\0" END
1 ICON DISCARDABLE "/home/bilesh/Pictures/icons/Webalys-Kameleon.pics-Apartment.ico"
10 RCDATA BEGIN "You need Java to run this application.\0" END
21 RCDATA BEGIN "http://java.com/download\0" END
8 RCDATA BEGIN ".\0" END
20 RCDATA BEGIN "32\0" END
101 RCDATA BEGIN "An error occurred while starting the application.\0" END
102 RCDATA BEGIN "This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.\0" END
103 RCDATA BEGIN "This application requires a Java Runtime Environment\0" END
104 RCDATA BEGIN "The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.\0" END
105 RCDATA BEGIN "An application instance is already running.\0" END
23 RCDATA BEGIN "SocietyManagementSystem\0" END
24 RCDATA BEGIN "SocietyManagementSystem\0" END
17 RCDATA BEGIN "true\0" END
net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/bilesh/Launch4j/launch4j/bin/windres": error=2, No such file or directory
As the error suggests, I thought that the concerned file is missing in the given folder but that is not the case. Following is a screenshot indicating the same:
I'm using Ubuntu 16.04 64-bit and the version of launch4j that I'm using is 3.9.
I took a look at this answer and tried installing the 32-bit libraries using the following command:
sudo apt install ia32-libs
But I got the following error:
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32ncurses5 lib32z1
E: Package 'ia32-libs' has no installation candidate
So, I went ahead and installed the replacement packages:
sudo apt install lib32ncurses5 lib32z1
But I still keep getting the above error when running launch4j. Can this be resolved?
I solved the same issue on Ubuntu 20.04 by installing the packages libc6-i386 and gcc.
I worked this out by running file to discover the link to /lib/ld-linux.so.2:
jbaxter#vmssaf66e00000G:~/launch4j-plugin-1.5.0.0-workdir-linux/bin$ file windres
windres: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, stripped
Which did not exist on the relevant system.
Then running apt-file on my local system which was working:
jbaxter#dev-jbaxter:~$ apt-file search /lib/ld-linux.so.2
libc6-i386: /lib/ld-linux.so.2
After installing libc6-i386 there was an error message indicating gcc could not be found - this was straightforward to resolve by installing the corresponding package.
This happened on an Azure VM Image supplied by Canonical.
Shell cannot run executable file eclipse even if I enter proper path. the file is executable and readable.
Why bash cannot find the file?
I've also install java (openjdk-7-jre), and normal eclipse is running well
~/eclipse:
about_files eclipse.ini icon.xpm notice.html
about.html eclipse-wrapper jre plugins
configuration epl-v10.html libcairo-swt.so readme
eclipse features LICENSE.TXT startup.jar
$ ./eclipse
bash: ./eclipse: No such file or directory
It could have to do with 32 bit vs 64 bit. If you download the wrong package for your architecture, you could end up with this message instead of a more informative message saying that you are running the wrong version of eclipse for your machine
So I've been Googling and searching for literally 3 hours now for this solution. I used to have some files for this purpose but they have been deleted over the years.
Basically, I have a .jar file named RiD.jar located in: /Users/Mom/Desktop/RiD
The .jar was recently updated with changes that may allow the possibility of support for Mac OS X. I have been given the task of testing it in a Mac OS X environment.
I need to make a double-clickable file that will open the .jar file that can be added to the initial download (a .rar file containing a folder of all the included files, one of which being the RiD.jar) that will work universally for all Mac users.
Whether it uses AppleScript or something else, as long as it works I'm happy.
For the creation of any specific file type in your recommendation, please do me the favor of explaining what program would be used to make this file type and any other relevant information, as my OS X programming knowledge is limited.
Any help is appreciated and any questions you might have for me are more than welcome.
EDIT:
Here's a copy of what I get when I try and open it via the Terminal:
I have the newest version of Java included in the Mac App Store (e.g. Java 6 update 41).
java.io.IOException: Cannot run program "cmd": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at java.lang.Runtime.exec(Runtime.java:328)
at Run.main(Run.java)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:91)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 4 more
EDIT: I just updated to Java 7 update 15 from the Oracle website because it is needed to run a Java applet in a browser that must work for the purpose of the original RiD.jar file. I still get the same error as from Java 6 update 41.
EDIT: I've spoken with the developer and he's removed the use of cmd when using OS X. I now have a slightly different error:
My-Computer:~ Mom$ cd /Users/Mom/Desktop/RiD
My-Computer:RiD Mom$ java -jar RiD.jar
java.io.IOException: Cannot run program "javaw": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at java.lang.Runtime.exec(Runtime.java:328)
at Run.main(Run.java)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:91)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 4 more
enter code here
The error trace seems to show that the Java code calls "cmd", presumably to run some script. If this is the case, it will obviously not work on a Mac without some code change of the underlying Java code.
In general, to run JAR files on Mac requires that you install Java from Oracle. After that install, jar files should be associated to launch with Java on a normal double click.
UPDATE (to match updated question): The JAR file is trying to call the javaw, which is the console-less runtime for Java. Without seeing the code, I can't say why it's doing this, but it looks like a PATH error. In the terminal, try to write
which javaw
My guess is that it won't find the correct destination for javaw. The solution is either that you manuaylly edit your environment to include a path to javaw, if you can locate it, otherwise, easiest is to re-install Java from Oracle and see if the problem disappears.
It could also be that the script in the JAR file assumes an incorrect path for javaw, for example by assuming it to be located in a typical Windows path.