GlassFish does not start - java

I'm starting with the Glassfish technology. I found this impediment, after having downloaded and put on disk c: the installer, I go to the windows command screen and execute the command "asadmin start-domain", but my answer is
-jar: illegal argument.
I have already configured the JAVA_HOME and the route. But it does not work. Could you suggest something?
The version of the Glassfish Platform is 4.1.2
The Java Development Kit version is 8
Command line
asadmin start-domain
Path JAVA_HOME

In addition to Ramanlfc's comment, you will also need to check your environment variables. On Windows, you will need to add your JDK's binaries location (%JAVA_HOME%) to the system path in order to start GlassFish:
https://www.mkyong.com/java/how-to-set-java_home-on-windows-10/

Related

What makes Oracle SOA Suite 12 JAR unable to recognize the JAVA_HOME?

I am trying to install Oracle SOA Suite 12 on Windows 10. I set the JAVA_HOME correctly (able to echo it), and then trying to run the JAR. It gives me the following message:
This installer must be executed using a Java Development Kit (JDK)
but C:\Program Files\Java\jre1.8.0_161 is not a valid JDK Java Home.
It seems to look for the JRE folder and by default neglecting the JAVA_HOME environment variable. I did a workaround by navigating to the JDK folder, and then running the java.exe inside the JDK folder (java.exe -jar /path/to/soasuite). It works well. I just want to know what might be the reason.
I advise you to set the properties as follow. Adapt correctly to your path in the JAVA_HOME property, and the others will follow.
JAVA_HOME := C:\java\jdk1.8.0_151
JDK_HOME := %JAVA_HOME%
JRE_HOME := %JAVA_HOME%\jre
CLASSPATH := .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
PATH := %JAVA_HOME%\bin;%PATH%
EDIT:
I did a workaround by navigating to the JDK folder, and then running
the java.exe inside the JDK folder (java.exe -jar /path/to/soasuite).
It works well. I just want to know what might be the reason.
This means that you are missing the change in the PATH environment.
I was not able to utilize the path variables described - did not want to restart the machine durng and install of oracle software. I was able to successfully complete the install of weblogic oracle fusion by doing the following.
RUN JAR files using command prompt due to having issues running the java installed setups for oracle12c, weblogic ,etc.
RUN command prompt as adminsitrator:
1. CHANGE DIRECTORY IN COMMAND PROMPT TO:
C:\Program Files\Java\jdk1.8.0_181\bin
RUN the command like this - pointing to the proper JAR file.
java -jar c:\oracleformssoftware\fmw_12.2.1.3.0_infrastructure.jar
This definately worked for me but please note I did finally setup the path variables instructions noted here.

Unable to Start Talend Tool JAVA Version incompatibility

My Talend tool version is 5.6. As mentioned in Talend documentation it needs Java Runtime Environment 7 i.e jdk1.7, which is installed - along with set java_home in my environment variables. As per me it should work.
However I have jdk1.8 installed too, but I'm correctly pointing jdk1.7 path at environment variable.
Alternatively I have tried giving jdk1.7 path in Talend's Talend-Studio-win-x86_64.ini file. It's still giving me error.
Below is snapshot: in cmd the installed version shows jdk1.8 where in echo %JAVA_HOME% it shows path of jdk1.7
While starting tool this error comes:
Create a batch file with the following command:
Talend-Studio-win-x86_64.exe -vm "[jdk path]\bin"
Then start the studio by executing this batch.
Talend is based on eclipse, so you can set the java vm to use in the ini-file. (Sorry, I don't have an installation here right now, I think it is called talend.ini - nevertheless, it is located in talend's installation folder.)
Add the following to the top of the file:
-vm
[path to your java 7]/bin/javaw.exe
try to make changes in TOS_DI-win-x86_64.ini file
add line
-vm
C:\Program Files\Java\jdk-11.0.14\bin\javaw.exe
And update or confirm the version as below.
-Dosgi.requiredJavaVersion=11.0.14
Hope it'll help to fix the issue
Suppose you have talend in c:\talend and jdk1.7 is in C:\jdk1.7.
You can do like the following in windows environment.
Open command prompt.
Goto the bin folder location where jdk 1.7 is located. For example if you have jdk in C:\jdk1.7 then
cd\
cd C:\jdk1.7\bin
Then from bin folder of jdk type the full uri of the executable and hit enter.
In the above supposition c:\jdk1.7\bin>c:\talend\tos_di-xxxxx.exe
In the above statement tos_di-xxxxx.exe is the executable file depending on the os environment

Eclipse - exception occured executing command line, No such file or directory

I recently came across a library that I needed to use, Jpcap, that requires a 32-bit JVM to run. After installing 32-bit Java on my machine running Ubuntu and configuring my application in Eclipse (Mars) to use that version of Java, I encountered the following error,
Exception occurred executing command line.
Cannot run program "/usr/lib/java/jre1.8.0_91/bin/java" (in directory "/home/[USERNAME]/EclipseWorkspace/[APPNAME]"): error=2, No such file or directory
I have verified that the path to the JRE directory is correct and that the java executable is present. Is there some configuration step that I'm missing? Does anyone have an idea of why Eclipse might not be able to get to that directory?
You may have forgot to update the JAVA_HOME environment variable. If that's the case you may want to follow this guide:
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
Basically you can use sudo update-alternatives --config java to get the java installation path and then edit, as su, the file /etc/environment adding or editing the field JAVA_HOME="YOUR_PATH", where YOUR_PATH is the actual java installation path. At this point you can either restart your machine or just reload the environment variable by typing source /etc/environment.
Hope this helps!

Tomcat 7 startup error: tcnative.dll is not valid

I use;
Windows 7 64 bit,
JAVA_HOME= JDK1.7 64 bit,
Tomcat-7 64 bit version
When I start tomcat from commandline it works ok, but when I use it within IntelliJ I get this error;
java.lang.UnsatisfiedLinkError: tcnative-1 (.\tcnative-1.dll is not a valid Win32 application.
I also point to an IBM 32bit JDK1.6 from IntelliJ in project settings, but this could not be a problem since this setup works on some other collegae's computers
I have read similar questions here, but none of them offers a solution for my case, any ideas, how can I fix this?
Here is a link which describes the problem :
Cause:
You get this message when you start Tomcat. Tomcat is looking for a shared object call tcnative (dll or so depending on the platform). If it doesn't find it, it'll revert to java libs. Either way, this shouldn't affect your application. tcnative dll is needed to address scalability in Tomcat.
Solution:
Turn down debugging level for Tomcat or
Get tcnative from http://tomcat.apache.org/native-doc/ (windows users can download the binary) and place it in your library path.
Lib path is usually: C:\Program Files\Apache Software Foundation{Apache Tomcat directory}\lib; for windows
Basically It seems that you may have an incorrect version.
Are you using multiple java on your machines if yes then try to look into environment variables for JAVA_HOME & PATH. Secondly, also paste the complete version of java and tomcat
Also run following commands at command prompt
java -version
javac -version
echo %JAVA_HOME%
And are you using MSI installer of tomcat or just a zip version of tomcat. Because in many cases MSI installer never work for some ghost reasons.

Jenkins, specifying JAVA_HOME

I installed openjdk-6-jdk on my ubuntu box using apt-get.
In system info jenkins is telling me Java.Home is /usr/lib/jvm/java-6-openjdk/jre
However when I specify that directory as JAVA_HOME in Jenkins : "configure system", it returns error message saying that directory does not look like a jdk directory.
it is also failing to pick up my maven install.
Am I missing something obvious ?
Your JAVA_HOME variable must be set to /usr/lib/jvm/java-6-openjdk and it must be available for the user that starts Jenkins.
From Kyle Strand comment:
As of April 2015 (I think), Jenkins requires Java7. Also note that the java binary path (JAVA) must be set to the correct version if the system default is still Java 6. Finally, for anyone wondering where these variables are set, it's in a config file listed with the installation instructions on the Jenkins webpage (e.g. for Debian it's /etc/default/jenkins).
Using Jenkins 2 (2.3.2 in my case), the right way seems to insert the following into your pipeline file:
env.JAVA_HOME="${tool 'jdk1.8.0_111'}"
env.PATH="${env.JAVA_HOME}/bin:${env.PATH}"
"jdk1.8.0_111" beeing the name of the java configuration initially registered into Jenkins
On CentOS 6.x and Redhat 6.x systems, the openjdk-devel package contains the jdk. It's sensible enough if you are familiar with the -devel pattern used in RedHat, but confusing if you're looking for a jdk package that conforms to java naming standards.
I was facing the same issue and for me downgrading the JAVA_HOME from jdk12 was not the plausible option like said in the answer. So I did a trial and error experiment and I got the Jenkins running without even downgrading the version of JAVA_HOME.
Steps:
open configuration $ sudo vi /etc/init.d/jenkins
Comment following line:
#JAVA=`type -p java`
Introduced the line mentioned below. (Note: Insert the specific path of JDK in your machine.)
JAVA=`type -p /usr/lib/jdk8/bin/java`
Reload systemd manager configuration: $ sudo systemctl daemon-reload
Start Jenkins service: $ sudo systemctl start jenkins
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: active (exited) since Sun 2020-05-31 21:05:30 CEST; 9min ago
Docs: man:systemd-sysv-generator(8)
Process: 9055 ExecStart=/etc/init.d/jenkins start (code=exited, status=0/SUCCESS)
I just wanted to add a solution for Windows machines.
Windows Server 2008 R2 Standard, SP1
Jenkins 2.89.4
Java version 8.171
Symptom: Jenkins service starts and immediately stops.
Jenkins.wrapper.log has a line indicating the incorrect path to Java:
- Starting C:\Program Files\Java\jre1.8.0_141\bin\java -Xrs -Xmx6g -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "C:\Program Files (x86)\Jenkins\jenkins.war" --httpPort=8080 --webroot="C:\Program Files (x86)\Jenkins\war"
The fix: Jenkins has the path hard-coded in jenkins.xml. Change the path to the new Java location.
<env name="JENKINS_HOME" value="%BASE%"/>
<!--
if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
The following value assumes that you have java in your PATH.
-->
<executable>C:\Program Files\Java\jre1.8.0_171\bin\java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>
You can also use Windows Environment Variables, but I wasn't successful with that and I don't think the Java installer updates those, so you'd need to update that by hand every time anyway.
<env name="JENKINS_HOME" value="%BASE%"/>
<!--
if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
The following value assumes that you have java in your PATH.
-->
<executable>%JAVA_HOME%\bin\java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>
openjdk-6 is a Java runtime, not a JDK (development kit which contains javac, for example). Install openjdk-6-jdk.
Maven also needs the JDK.
[EDIT] When the JDK is installed, use /usr/lib/jvm/java-6-openjdk for JAVA_HOME (i.e. without the jre part).
This is an old thread but for more recent Jenkins versions (in my case Jenkins 2.135) that require a particular java JDK the following should help:
Note: This is for Centos 7 , other distros may have differing directory locations although I believe they are correct for ubuntu also.
Modify /etc/sysconfig/jenkins and set variable JENKINS_JAVA_CMD="/<your desired jvm>/bin/java" (root access require)
Example:
JENKINS_JAVA_CMD="/usr/lib/jvm/java-1.8.0-openjdk/bin/java"
Restart Jenkins (if jenkins is run as a service sudo service jenkins stop then sudo service jenkins start)
The above fixed my Jenkins install not starting after I upgraded to Java 10 and Jenkins to 2.135
java jenkins java-home ubuntu centos
For those of you coming to this issue and have access to configure your Jenkins Agents, you can set the JAVA_HOME from the Jenkins > Nodes > "the agent name" > Configure page:
Setting "per agent" environment variables
In case anyone has similar problems, I used the default sudo apt-get installs for the relevant packages and here are the correct settings:
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
and
MAVEN_HOME=/usr/share/maven2
In Jenkins try setting JAVA_HOME to /usr/lib/jvm/java-6-openjdk
Upgrading from Ubuntu 10.0.4 to 12.0.4 we got wrong footed.
We had a JDK installation configured (auto-configured?) pointing to /usr/lib/jvm/java-6-openjdk
this no longer contained a JDK,
Changing to /usr/lib/jvm/default-java fixed, and should make for a seamless java-7 upgrade.
So in answer to the question: do not specify JAVA_HOME on Ubuntu.
In Ubuntu 12.04 I had to install
openjdk-7-jdk
then javac was working !
then I could use /usr/lib/jvm/java-7-openjdk-amd64 as path and jenkins didn't complain anymore.
Download package rpm package from http://pkg.jenkins-ci.org/redhat/ you can give additional java location like I have default 1.7 java in my system but I am using /opt/jdk1.8.0_60/bin/java for jenkins. Open jenkins startup script /etc/init.d/jenkins and add additional java here, I m case I have added /opt/jdk1.8.0_60/bin/java,
Search usable Java as /usr/bin/java might not point to minimal version required by Jenkins.
See http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html
candidates="
/opt/jdk1.8.0_60/bin/java
i saw into
Eclipse > Preferences>installed JREs > JRE Definition
i found the directory of java_home
so it's
/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home

Categories