Created jar from JRuby file using warbler. Application exit/goes in a blink when run - jruby

I have created a JRuby desktop application. Now I need to create installation file for different platforms(Windows, Linux, Mac).
I have created .jar file using warbler. But when I try to run the .jar, application starts and exit in a blink. It seems application is not crashing as the log says got via java -jar MyApp.jar > log.txt.
Why the application exit, doesn't just stay. Can somebody help me on what I am missing. How I can track the issue?

This answer will help for the issue: JRuby script with Rubeus and Swing exiting once packaged into jar using warble
The workaround described is to put below code in your App's main file
event_thread = nil
SwingUtilities.invokeAndWait { event_thread = java.lang.Thread.currentThread }
event_thread.join

Related

Is there any command or way to find out the location of my JUnit?

i have a MacBook Pro and have downloaded java version 1.8 and selenium also. But im unable to find JUnit. Can i get the command to check the location of my JUnit. I have tried using a code to check whether JUnit is installed and the output is successful.
JUnit is not part of the standard JDK content; same for selenium.
Thus: you have to do something to pull the JUnit jar to your system. Either by downloading it manually yourself; or by using a build system like Maven or Gradle that can take care about resolving "dependencies" and downloading required artifacts automatically for you.
But in order to locate jar files on your system, you can simply turn to find command, like:
find / -type f -name "*.jar"
which should list you JAR files existing in your file system. You can read here about this and other tools that help you find files in your file system using the command line.

I am having a jar file which I am calling from powershell script. As the jar runs google chrome crashes

I am having a jar file which I am calling from powershell script. Now when I run the script the jar file is called and when jar tries to open google chrome, it crashes. If I try running the jar outside the powershell script it works perfectly fine. I think this is a machine specific issue, because the script ps script runs perfectly fine on other machines. any suggestions??
Using Chrome's alternate installer. This will install Chrome for all users.
Link: Alternate Installer
This often fixes problems if you are running Selenium as a background service.
Passing '--no-sandbox' flag when creating your WebDriver session.
Special test environments sometimes cause Chrome to crash when the sandbox is enabled.

LibGDX creating (desktop) platform runnable

I want to export may project (game) to different desktop platforms. I exported it from eclipse (on Windows) and I get JAR file. On my machine I can start it, but on other it won't work. I guess JRE is missing there.
So, I followed LibGDX instructions how to deploy on different platforms:
https://github.com/libgdx/libgdx/wiki/Deploying-your-application
But when I run that packr.jar app I get following output:
D:\packing>java -jar packr.jar windows.json
Output directory 'D:\packing\windows' exists, deleting
Unpacking JRE
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
copying resources
minimizing JRE
unpacking rt.jar
packing rt.jar
Done!
After that I really get my exe file, all together with jre dir, my original game jar file and some config.json file, but that exe file just won't run. No failure message, just won't run. Any idea what's going on here? Or maybe there is some other tool for packing jar files?
All I need is to make my game runnable on desktop platforms: Windows, Mac & Linux.
For windows OS you could use something like launch4j which simply puts a wrapper around your jar file.
It also has the capability to provide a given jre. So your users do not need to have one installed.
Ok, solved this.
So I've found out that if I run exe file from console (cmd) and redirect output to file I can have some error report regarding the run attempt. So I did that:
myapp.exe > log.txt
and get log this log file:
Loading JVM runtime library ...
Passing VM options ...
# -Xmx1G
Creating Java VM ...
Error occurred during initialization of VM
Unable to load ZIP library: D:\packing\windows\jre\bin\zip.dll
Zip file was there, but something was wrong with it so I replaced it with one I had in my Java installation (my was larger). After that I was able to run exe file well.

Binary file refuses to run due to a missing shared library

I tried building recutils version 1.7 downloaded from the home page, using the standard configure, make, sudo make install sequence, but when trying to run the resulting binaries. like recinf, I get the error:
recinf: error while loading shared libraries: librec.so.1: cannot open shared object file: No such file or directory
Does this mean I made a mistake during the build or is the package itself in error?
As Etan Reisner said the problem was that the shared object libraries were installed but not loaded into the cache, hence the need to run ldconfig. After running
sudo ldconfig
the binaries ran properly. If I had looked in /usr/local/lib, I would have seen the libs there.

How to install cocos2d-x in windows8 and VS2013

I want to install cocos2d-x on my windows8 but i download this "http://bit.ly/18xmkJ9" from "http://cocos2d-x.org/download" in the tutorial says that i must execute a .bat in there or in some other pages says that i neet to create a project in VS, but when i try to do what they say in the tutorial i dont see anithing that is shown.
I'm very lost and help needed.
Could anybody say me hoy to createand start a project on cocos2d?
I have answer the similar question here.
Before cocos2d-x 2.1.2, you can still use templates in VS. However, you can only use python to create project
Install python 2.7
Open command line in Windows
Go to your cocos2d-x-2.1.5\tools\project-creator folder
Run create_project.py. Usage:
create_project.py -project YourProjectName -package com.example.PakcageName -language cpp
-language option:[cpp | lua | javascript]
Your project will be created in cocos2d-x-2.1.5\projects
Then find the win32.proj , open ***.sln