How to fill ini file for creating exe for Java app with libs (WinRun4J) - winrun4j

"MyApp" folder has now the following structure:
- MyApp
- lib
- MyLib.jar
- MyApp.jar
MyApp.jar has a manifest with Class-Path: lib/MyLib.jar
I want to add MyApp.exe file to "MyApp" folder. So I put all files required to create exe via WinRun4J to "MyApp" folder. Then I run bat file as described here. That gives me exe file with a proper icon but all I see when I run it is a splash screen. Where am i wrong? My ini file content:
main.class=my.main.class
classpath.1=lib/MyLib.jar
splash.image=SplashScreen.gif

You will have to include your main jar as well:
main.class=my.main.class
classpath.1=MyApp.jar
classpath.2=lib/MyLib.jar
splash.image=SplashScreen.gif
or to simply include all jars:
main.class=my.main.class
classpath.1=*.jar
classpath.2=lib/*.jar
splash.image=SplashScreen.gif

Related

Can js file be compiled in a different folder from the source folder?

I'm building an Obsidian plugin, and it uses esbuild to bundle ts file to js file. The ts file is located at D:\foo1\foo2\..., and I want the js file to be at D:\bar1\bar2\.... The reason for this is because I want the source folder is in a different folder than the plugin folder, so that when syncing it to mobile I don't have to exclude the source files.
I was suggested to edit the esbuild.config.mjs file, and I find in the documentation that beside the outfile config there are also outdir, outbase. However, these are the results when I'm using them:
outdir
outdir: 'D:\Quả Cầu\B Nội dung\Knowledge graphs\Cây vấn đề\.obsidian\plugins\dotmaker'
error: Failed to create output directory: mkdir D:\GitHub\Obsidian\dotmaker\D:Quả CầuB Nội dungKnowledge graphsCây vấn đề.obsidianpluginsdotmaker: The directory name is invalid.
outbase
outbase: 'D:\Quả Cầu\B Nội dung\Knowledge graphs\Cây vấn đề\.obsidian\plugins\dotmaker',
It prints the js content in the terminal, but the real file isn't changed.
It seems that I can only create the js file inside the source folder. Is that possible?
You didn't correctly format the content of the outdir setting. When using backslashes \ as path separator on windows, you have to escape them. Ie use
outdir: 'D:\\Quả Cầu\\B Nội dung\\Knowledge graphs\\Cây vấn đề\\.obsidian\\plugins\\dotmaker'

Unable to read xml file when using exe4j to package jar into exe

Recently I encountered a problem when using exe4j to package the jar into exe. My xml configuration file is placed in the same directory of the exe, but after the package is completed, the exe will look for the xml file from the temporary folder.
These are the instructions in the exe4j help documentation
For some applications (especially GUI applications) you might want to change >the working directory to a specific directory relative to the executable, for >example to read config files that are in a fixed location. To do so, please >select the Change working directory to: checkbox and enter a directory relative >to the executable in the adjacent text field. To change the current directory >to the same directory where the executable is located, please enter a single >dot.
The error when i running the exe :
[ERROR] In Log's init,cann't read config file, file=/C:/Users/**/AppData/Local/Temp/e4jEA8.tmp_dir1543543191//sys_log.xml
Why is the program not looking for this xml from the exe's sibling directory, and how can I find it from this directory?
If you are using the "JAR in EXE" mode, use
System.getPrpoerty("install4j.exeDir")
to get the parent directory of the executable.

Eclipse rcp 4 app export missing class files in the jar

I have a RCP 4 app with many plugin projects. The app runs well in IDE but when I run it after exported, some exceptions was throw (ClassNotFoundException).
I investigated then see that it's because of some classes had not yet been exported to the jar files. I don't know why? The configurations in MANIFEST.MF, plugin.xml, build.properties are same but some can export the class to jar file, some not.
Can you help me? Thank you very much!
Update: build.properties file
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
item_editor.e4xmi,\
plugin.xml
Update: MANIFEST.MF file
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Item_editor
Bundle-SymbolicName: xxx;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: xxx
Require-Bundle: org.eclipse.e4.ui.model.workbench,
org.eclipse.osgi.services,
org.eclipse.jface,
org.eclipse.e4.core.services,
xxx,
xxx,
org.eclipse.nebula.widgets.nattable.core,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.core.contexts,
org.eclipse.e4.core.di,
org.eclipse.core.runtime,
org.eclipse.e4.ui.di,
xxx;bundle-version="1.0.0",
org.eclipse.e4.core.di.extensions;bundle-version="0.15.0",
xxx,
xxx,
xxx
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: javax.inject;version="1.0.0"
Export-Package: xxx,
xxx,
xxx,
xxx,
xxx;x-internal:=true,
xxx
I was just facing this issue for couple of days! it was really annoying. here is what we did for our project to start copying the .class files into the package:
Our problem: None of the project classes (our classes) are copied inside the exported jar when it is exporting the project.
In the eclipse, we open the .project file we have for the build. It will open it in the editor section.
In the content menu, we click on our own Module entry (we named it XXX_BCC) and it opens it in a sperate editor.
Then we need to go to the build tab as you can see in the picture below.
Add our bin (it is the output folder specified for our .class files) to the . classpath!
Under Runtime Information, When we were opening it before the change, it was only src/, you can press Add Folder.. and add the bin/ there. It will add the content of the bin folder to the root of the classpath in the exported JAR file.
We did the export again and our class files were there and we did not receive that exception again.
Here is the build.properties file after the change:
-Below is the content of our JAR file after the change and export again. Please notice our packages like _bcc and YYYY in the JAR content. They are our classes that were missed before.

Openshift JBoss Logging

Hi I am deploying my spring application to Openshift Jboss AS. The problem is whereever i placed the log4j.properties it is not read by the application. I've tried the following ways to achieve this but can't.
Placed my log4j.properties in WEB-INF/classes.
Placed my log4j.properties in WEB-ING/resources and in web.xml loaded the
context-param for log4jConfigLocation.
Created a
jboss-deployment-structure.xml in META-INF which excludes log4j
logging.
Nothing seems to work . Can some one please help me.
In Jboss there is a default logging available, which can be implemented by modifying standaole.xml.
In Openshift when you ssh into your app using the below command
rhc ssh <app-name>
You will taken into your application where when you give ls command you will see the list of files and folders, you can find jbossas folder change your working directory to that folder
cd jbossas
execute ls command you will see list of folders where you will find standalone folder, change your working directory to this folder
cd standalone
again execute ls command you can see configuration folder, change your working directory to this
cd configuration
now if you execute ls command you can see standalone.xml, we need to edit this file, but editing here may not work because this standalone.xml is a copy of the another file which is in the following folder .openshift/config/standalone.xml . You can find this folder where you clone your git copy, Not in eclipse go to your working directory in window.
We need to edit this file and add our logging properties here. thats how it works

warbler doesn't packages a standalone application in a jar file but instead in a war file

I've a JRuby-based standalone application with the following structure:
my_app
- bin
- my_app # that's a launcher script
- lib
- my_app.rb
And when I warble in the top level directory, it doesn't generates a jar file as expected but instead a generates a war file. And this war, as expected, follows the war file's standard structure.
I've followed the documentation to do it:
https://github.com/nicksieger/warbler
"If your project do not have a .gemspec, Warbler will attempt
to guess the launcher from the contents of the bin directory
and use the lib directory as the lone require path. All files
in the project will be included in the archive."
Anyone already did it?
Thanks a lot!
This functionality is in version 1.3.0 which unfortunately hasn't been released yet. Try the prerelease version on rubygems.org (gem install warbler --pre).

Resources