Java path error while installing glass fish 3.1.2 - glassfish-3

I installed JDK 7 update 5 (64 bit) on my server(Server has 64 bit windows OS). Set the environment path. When i do java -version. I get the output java version 1.7_0_05 but when i try to install glass fish then i get the error that This application needs version 1.6 or higher of the Java (TM)2 Runtime Environment . I have set both the JDK bin folder and JRE bin folder on my environment path. Why i am getting this ?
Thanks

I didn't update the environment variable but i think path should be to JRE that is inside JDK like i tried this and it worked
D:\Basit>ogs-3.1.2-windows.exe -j "c:\Program Files\Java\jdk1.7.0_05\jre".
Hope this answer will help others also.

Open cmd make sure you cd to the path of you glassfish installation file :cd C:\Users\John\Downloads
locate your jre file which should be in your jdk1.7x : C:\Program Files\Java\jdk1.7.0_11\jre
In the cmd paste this : glassfish-3.1.2.2-windows.exe -j "C:\Program Files\Java\jdk1.7.0_11\jre"
make sure you have the correct version

In my case, the problem was a blank space in "Program Files" (Yes I have JAVA_HOME set) You can run installation from cmd with argumentation (do not forget quotation) -j "c:/.../java path" Example from my case:
c:\Users\Kryst\Downloads>glassfish-4.0-web-windows.exe -j "C:\Program
Files\Java\jdk1.7.0_ 79\jre"

Fixed.
Java Version > Java v1.6
Open downloaded folder and select
shift+right-click+open-command-window-here
Type exact file name of downloaded file -j and JRE path
in my case
ogs-3.1.2.2-windows.exe -j "c:\Java\jdk1.8.0_31\jre

Try setting JAVA_HOME environment variable to the JDK root folder.

or just download a bundle package such as http://netbeans.org/downloads/ and click on the Java EE or ALL catagory

Related

intalling PHPUnit on Windows

I have XAMPP 5.6.3 installed on Windows 32bits (PHP Version 5.6.3), and I want to install PHPUnit.
I followed the instruction in the official site of PHPUnit :
https://phpunit.de/manual/current/en/installation.html#installation.phar.windows
but when I run this line phpunit --version in the command line, I get this message :
'php' is not recognized as an internal or external command, operable program or batch file.
how can I solve this problem ?
The problem was that PHP is not included in my PATH.
So I followed this solution :
Windows button + Pause
List item
Advanced System Settings
Environment Variables
append PHP installation dir to the PATH variable.

Apache Directory Studio- JRE Issue

When I am trying to run Apache Directory Studio in ubuntu, I am getting the Following error,
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run ApacheDirectoryStudio. No Java virtual machine was found after searching the following locations: /data/Admin/Work/ApacheDirectoryStudio-linux-x86-2.0.0.v20130628/jre/bin/java java in your current PATH
Where can I specify the JRE location? Is that in conf.ini? Then How can I set it?
(I am unable to tag Apache Directory Studio in this question.)
In folder with Apache Directory Studio there is Apache Directory Studio.ini file where java path can be set.
I got the solution. I have copied JRE into my Apache Directory Studio Folder.
In Windows OS
Below worked for me.
Go to environment variables, by running below command in Run or Cmd
rundll32.exe sysdm.cpl,EditEnvironmentVariables
Add below (or your jdk directory) to User Path, in Environment variables
C:\jdk-13\bin
Hope that solves.
In folder with Apache Directory Studio there is Apache Directory Studio.ini file where java path can be set.
include the following lines:
-vm
/home/yourUser/Downloads/jre1.8.0_211/bin
change "/home/yourUser/Downloads/jre1.8.0_211/bin" for your path to jre 1.8
I have fixed this issue by adding below lines in Info.plist file
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java</string>
Reference : https://github.com/Homebrew/homebrew-cask/issues/51629
I faced this same issue. I got it resolved by manually adding below lines in C:\Program Files\Apache Directory Studio\ApacheDirectoryStudio.ini
-vm
C:/Program Files/Java/jdk-11.0.17/bin
Please remember the value is without quotes.

Running JavaFX applications on Redhat 5

From my previous question, I know that JavaFX is not supported in RedHat 5.8 meaning, even when I have Java 8 (jdk1.8.0_05) installed on my Linux, a JAR file created in win7 can't be executed via java -jar helloworld.jar. Does that mean there is NO way to run JavaFX jars on this machine?
The problem with running JavaFX applications on RHEL5 is the version of glib that comes with that OS is not new enough. The trick, then, is to provide a newer version of that library and all of the other libraries that depend on it to the JRE. The next hurdle is that RHEL5 shared library loader won't load those libraries. You have to use a compatible loader. But the JVM has the path to the loader hard-coded in the executable! So you need a separate JVM with a custom loader path patched in. Roughly, the steps to get this working are...
Unpack the following packages from RHEL6:
glib2
libffi
glibc
glibc-common
zlib
gtk2
pango
cairo
pixman
Put all of the shared libraries from those packages in a directory on your RHEL5 system. Let's call it /YOUR-ALIEN-RHEL6-LIBS-PATH.
Unpack another copy of a JRE to, say, /YOUR-ALIEN-JVM-PATH.
Use patchelf to point the JVM executable to the new loader.
./usr/bin/patchelf --set-interpreter /YOUR-ALIEN-RHEL6-LIBS-PATH/lib/amd64/ld-linux-x86-64.so.2 /YOUR-ALIEN-JVM-PATH/jre1.8.0_25/bin/java
Run the application after setting LD_LIBRARY_PATH=/YOUR-ALIEN-RHEL6-LIBS-PATH/lib/amd64:/YOUR-ALIEN-RHEL6-LIBS-PATH/lib/amd64/jli
Although it is not pretty, I have successfully run JavaFX applications on RHEL5 using this method. Having said that, I highly recommend just upgrading your OS if it is even remotely feasible.
Note this builds upon the existing answer from James with more concrete detail
Obtain RPMs from a RedHat 6.x, e.g. http://vault.centos.org/6.2/os/i386/Packages. Copy into directory rpms/
cairo-1.8.8-3.1.el6.i686.rpm
glib2-2.22.5-6.el6.i686.rpm
glibc-2.12-1.47.el6.i686.rpm
glibc-common-2.12-1.47.el6.i686.rpm
gtk2-2.18.9-6.el6.centos.i686.rpm
libffi-3.0.5-3.2.el6.i686.rpm
libXcomposite-0.4.1-2.el6.i686.rpm <== not mentioned in other answer
pango-1.28.1-3.el6_0.centos.5.i686.rpm
pixman-0.18.4-1.el6_0.1.i686.rpm
zlib-1.2.3-27.el6.i686.rpm
libXdamage-1.1.2-1.el6.i686.rpm <== not mentioned in other answer
Extract all the contents from the RPMs into separate directory. Use rpm2cpio and xzcat. xzcat can be installed from these RPMs if necessary [xz, xz-libs, xz-lzma-compat]
mkdir redhat-6u2-libs
cd redhat-6u2-libs/
ls -1 rpms/* | xargs -i{} bash -c "rpm2cpio {} | xzcat | cpio -idmv"
Obtain copy of patchelf. I built from source as couldn't find a Redhat 5 RPM. Only requires dependent RPMs [gcc, gcc-c++, glibc-devel, kernel-headers, libstdc++-devel]
wget https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2
tar xjf patchelf-0.9.tar.bz2
cd patchelf-0.9
./configure --prefix /tmp/patchelf
make install
Use patchelf to set location of redhat 6u2 loader (aka interpreter)
/tmp/patchelf/bin/patchelf --set-interpreter ~/redhat-6u2-libs/lib/ld-linux.so.2 jdk1.8.0_40/bin/java
Set LD_LIBRARY_PATH, this needs to have both /usr/lib and /lib, otherwise you get a segfault.
export LD_LIBRARY_PATH=/home/user/redhat-6u2-libs/usr/lib:/home/user/redhat-6u2-libs/lib
(Note that any other applications run after LD_LIBRARY_PATH is set other than java which has had its interpreter location corrected will segfault.)
Now run java app...
./jdk1.8.0_40/bin/java -cp etc...
Happy days

JAVA_HOME is set to an invalid directory

I'm working with gradle and trying to deploy my JAVAFX application into .apk
If i run my gradle command it says that my JAVA_HOME is set to an invalid directory.
It is set to C:\Program Files\Java\javaversion\bin
(there is an actual version actually, but it isn't necessery atm)
And the same is at the environment variable.
Any ideas, why i'm getting this error?
What is JAVA_HOME?
Its an Environment variable that helps to locate JDK and JRE.
As you are setting it to.
C:\Program Files\Java\javaversion\bin
JAVA_HOME Should be set to root directory not upto bin
C:\Program Files\Java\javaversion
And in path variable put
C:\Program Files\Java\javaversion\bin OR %JAVA_HOME%\bin
You can read more about from This Link.
JAVA_HOME should be pointing one directory up, not at the bin directory
instead of
C:\Program Files\Java\javaversion\bin
use
C:\Program Files\Java\javaversion
#charen You are right. Gradle, as of its last version 3.4.1, only works with Java 32 bits. So your JAVA_HOME shoud point to the Java JRE at Program Files (x86).

qmake: could not find a Qt installation of '' - Setting up qmake?

qmake: could not find a Qt installation of ''
This thread was not of any help to me. qmake: could not find a Qt installation of ''.
How can I get qmake to recognize where the Qt folder is?
Right now it is installed in /opt/Qt5.1.0.
Have you installed the qt5-default ? You need to do this in addition to running the Qt supplier .run file.
sudo apt-get install qt5-default
This message shown by qtchooser app.
To setup it properly, you should make conf files in /etc/xdg/qtchooser/
for example:
$ ls -1 /etc/xdg/qtchooser/
default.conf
qt-4.8.5.conf
qt-5.1.0.conf
each file has two lines: path to bin, path to lib:
$ cat /etc/xdg/qtchooser/default.conf
/opt/Qt/4.8.5/bin
/opt/Qt/4.8.5/lib
additional info: man qtchooser
The solution for me on this problem was to specify the QT version, as this message was being generated by /usr/bin/qtchooser
So in my case, it was QT4 I was trying to use, and running:
qmake
generated the error (could not find a Qt installation of '')
qmake -qt=qt4
fixed that error though. In my case, it was a Ruby Gem trying to compile with qmake, so I couldn't get it to pass in that extra command line argument, so I instead added this to my profile
export QT_SELECT=qt4
And now QT4 runs just fine on my Ubuntu system.
For me the symlink to default.conf was missing in /usr/share/qtchooser. It wasn't enough to put it into /etc/xdg/qtchooser.

Resources