I am trying to run an application called vdbench on my windows2008R2 which is a VM. However, the application does not have 64 bit support and can be only run with 32 bit version of Java. I am trying to understand if I can install the 32 bit JRE and run the application on the windows2008R2 64 bit server? I tried it but the application is not able to run saying 'java' is not recognized as a program. I am wondering if I need to map my windows2008R2 to run the specific 32bit version of JRE?
You need to do nothing except install the 32-bit JRE / JDK whatever your requirement.
I do this all the time. The only real reason to use the 64-bit version is if you application needs to be able to access more than 4GB of RAM (or some programmatic lib dependency)
Make sure you install the 32-bit version and point the JAVA_HOME environment variable to the install dir so if you install JRE 1.6 it JAVA_HOME should be something like
C:\Program Files (x86)\Java\jre1.6.0_XX
Also, in your Path environment variable add %JAVA_HOME%\bin to its end, this will make all the java executable's available at the command line.
In the case of a JRE you can use an environment variable called JRE_HOME if you want instead of JAVA_HOME.
You can also add -d32 to the JVM options, which should tell the JVM to run in 32-bit mode.
You must install a 32-bit JDK or JRE. Then, add a new system environment variable named EXE4J_JAVA_HOME pointing to the new install dir (there's no need to overwrite the JAVA_HOME env. var.).
Related
I made a desktop application using netbeans version 6 and after that converted the jar file into exe file using launch4J. But it gives me the error "no main manifest attribute".
Please help me in finding a solution.
And also How I will specify jre version in launch 4j?
Answer to your second question:
You can not specify the JRE version in generated .exe. The version is set in system environment variables of Windows of the machine running the executable.
What you can do is specify the min and max JRE versions which can be used to run your program.
To set min version, navigate to tab 'JRE' in Launch4j and write '1.8.0' to Min JRE version. If you want another version, replace the text with corresponding version.
I am deploying a Java EE project in a server that uses the MCR of Matlab for some image processing functions. I've been trying this for months I can't make it work. The problem is when it is going to uses the MCR it cannot find the .so libraries. I got this error:
javax.servlet.ServletException: Failed to find the library libmwmclmcrrt.so.7.13, required by MATLAB builder JA, on java.library.path. This library is typically installed along with MATLAB or the MCR, its absence may indicate an issue with that installation or r the current path configuration. The MCR version that this component is trying to use is 7.13.
ROOT CAUSE:
java.lang.UnsatisfiedLinkError: Failed to find the library libmwmclmcrrt.so.7.13, required by MATLAB Builder JA, on java.library.path. This library is typically installed along with MATLAB or the MCR, its absence may indicate an issue with that installation or the current path configuration. The MCR version that this component is trying to use is: 7.13.
The servers uses:
Ubutuntu 64 bits.
Netbeans 7.4
Glassfish
java 6 sdk
first it uses MCR 7.13 now it uses MCR 8.1
Things I've already tried:
Setting the environment variables LD_LIBRARY_PATH and XAPPLERSDIR with export:
export LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/bin/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64:$LD_LIBRARY_PATH
export XAPPLRESDIR=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/X11/app-defaults
Setting the environment variables LD_LIBRARY_PATH and XAPPLERSDIR with setenv:
Command setenv not found
Edit ld.so.conf file and run ldconfig
Add -Djava.library.path=my/path/to/so in glassfish
Add -Djava.library.path=my/path/to/so in Netbeans like says here:
giving 'java.library.path' in netbeans for .dll/.so files
I tried to set environment variables in Netbeans like said in this post: How to set Environment Variable in Netbeans?
But I can't find "Actions"
I tried to set environment variables in Netbeans like said in this post: https://askubuntu.com/questions/267071/ld-library-path-specification
But I can't find "Environment"
I've tried lots of more things that I can't remember and none of them works, it keeps showing the same error (now for version 8.1 instead of 7.13). Please I would I appreciate any help.
I had the same problem working with Linux, Java EE and Matlab. My solution was:
Open a terminal
Log as root $ su and type password
Edit the /etc/enviroment $ gedit /etc/enviroment
Add the needed variables, in our case:
LD_LIBRARY_PATH="/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/bin/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64"
XAPPLRESDIR="/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/X11/app-defaults"
Save the file and reboot.
Start the server as root.
What happened with your other solutions, like the export, was that there was no visibility between the variables that you created and the GlassFish server. Setting variables in the environment will asure you that they are visible from any other program/process.
I have an existing Java program that I am giving to some.... not so technically inclined clients of mine. They use a combination of Linux, Windows, and very few have apple machines, which is why I chose Java to develop the program in. The problem is they keep calling me with errors when they try to launch the program because they do not have a JRE installed. Is there any way to:
Import a lib that will give me some kind of command to check.
Add something to the program that will check for the JRE.
or (and I really don't want to go about this because of the reason I chose java in the first place)
Write something in C++ that will check for the JRE.
My aim:
Check if JRE installed on machine
If yes: Launch program
If no: pop up a message saying "No Java Environment found, downloading from Java website". Then I would take them directly to the link where they hit "run" and it installs.
// i would do something like
if (JRE.exists()) // maybe use a pathname that would only show up if a JRE is installed
{
// launch program
}
else
{
// launch Java installer
}
system.exit(0);
I understand this would be really hard in java (as you cannot run Java programs without a JRE) but I prefer to keep this universal if at all possible.
If there is no easy fix, I'll just make a read-me file that has the link to the java website that checks for a JRE on your system, but the least amount of work the user has to do the better.
I would suggest you use an Java installer like IzPack or other such free tools. Using one of these you can create an installer and also generate a native launcher. This can be configured such as it searches for Java and if not found, it can help the user installing it.
There are developers that also use JSmooth or Launch4J for native launchers.
check for JRE on system
Use deployJava.js as mentioned in the Java Web Start info. page.
..designed to ensure a suitable minimum version of Java is installed before providing a link to a JWS app. or launching an applet.
If it is a rich client desktop app. (e.g. applet or frame), deploy it using Java Web Start.
If you can't go with Java Web Start, although I'd recommend using it, you can write simple scripts to detect Java.
For Windows (.bat):
if not "%JAVA_HOME%" == "" (
"%JAVA_HOME%\bin\javaw.exe" -jar YourApp.jar
) else (
start http://java.com/download/
)
If JAVA_HOME environment variable is defined, then javaw.exe will be started with your application jar file. The javaw.exe executable uses window subsystem thus it runs without console window.
If JAVA_HOME is not set, it will open the Java download page in the default browser.
For more options, you can use JScript; with it you can display a warning to users that Java is not installed and then open the browser for download.
For Linux (.sh):
if [ "$JAVA_HOME" != "" ]; then
$JAVA_HOME/bin/java -jar YourApp.jar &
else
echo JAVA_HOME is not set: Java Runtime Environment (JRE)
echo is not installed your system.
echo Either install it from http://java.com/download/
echo or set JAVA_HOME environment variable.
fi
why don't you just create batch and bash files doing that and ask your customer to run one or the other dependently on the OS
if the JRE is installed on a system, then JAVA_HOME environment variable is set on both Windows and Linux and it contains the path of JRE. You can check if this variable is set and accordingly proceed.
I want my jruby 1.6.1 installation to operate with ruby 1.9 mode only. I want to uninstall or surely disable the support for 1.8.7 because I do not want to pull my hair out if I forget to set the environment or the command line parameter somewhere.
And also! I have another JRuby (1.5.1) installation on my machine which I want to keep there in safety using ruby 1.8.7. I would like to have ruby 1.9 compatibility when (and only when) I choose "c:\opt\jruby-1.6.1" as "Ruby platform" in NetBeans, or I set my PATH to include "c:\opt\jruby-1.6.1\bin", and so on.
All words in one: I want to lock my jruby installation to a ruby version regardless of the environment. Or is there a jruby 1.6.1 installer with ruby 1.9 exclusively? If not, why not? Should I even wish for that?
You can specify the JRUBY_OPTS environment variable: JRUBY_OPTS = --1.9
If you do it in your Windows system environment variables it will always apply anywhere a JRuby executable runs.
If you only add it to your Netbeans project properties then you could have it different depending on which configuration you select. e.g. Don't set it for your JRuby 1.5.1 configuration.
You cannot have it change automatically just by changing your PATH environment variable though.
I have to make an installer for motionbuilder 2011 for 32 bit and 64 bit.
The installer should detect and deploy the corresponding plug-ins.
One of the 64 bit machines has both versions installed on it but the registry shows only one of them at a time.
Is there any way to detect both the installed versions and deploy the corresponding plug-ins in their install directories?
Thanks
you have to query HKEY_LOCAL_MACHINE64 to get MoBu 64-bit path. For example, using Inno Setup script:
32-bit path
RegQueryStringValue(HKEY_LOCAL_MACHINE, Software\Autodesk\MotionBuilder\2011, 'InstallPath', path)
64-bit path
RegQueryStringValue(HKLM64, Software\Autodesk\MotionBuilder\2011, 'InstallPath', path)
Hope that helps!