Jboss runs using java 6 instead of java 8 - java-8

I changed the file name .openshift/markers/java7 to java8 but now when i start the gear it uses java 6 instead of java 8 and fails when trying to load classes with java 8 code. How can i make the app use java 8?
I use Tomcat 6 (JBoss EWS 1.0) in openshift.

As stated in openshift documentation about the java8 tomcat marker:
Will run Tomcat with Java8 if present. If no marker is present then the baseline Java version will be used (currently Java6)
It seems that Java 8 is not present in your server, and that is why it is falling back to Java 6.
All you need to do is to make Java 8 available in your server (as described in this answer):
rhc ssh yourAppNAme
cd $OPENSHIFT_DATA_DIR
cdwget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz
tar -zxf jdk-8u5-linux-x64.tar.gz
export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_05/bin:$PATH
export JAVA_HOME="$OPENSHIFT_DATA_DIR/jdk/jdk1.8.0_05"
And add the folowing lines to your start action hook (.openshift/action_hooks/start)
export JAVA_HOME="$OPENSHIFT_DATA_DIR/jdk/jdk1.8.0_05"
export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_05/bin:$PATH

Related

I am getting a error during using apache derby

This is my screen.
How can i resolve this problem or how i switch my valid java version. I installed java 8 and i did enter this command that "alternatives --set java java 8 path file". But he don't run.

JHipster Spring Boot executable war config not recognized

I am trying to experiment with a JHipster 4.3 app using Hazelcast. I have a setup of 3 Linux/CentOS7 VMs, each with latest 8 131 java/jdk on them. I build my war file for -Pprod and deploy to a dir at:
/var/jhiphaze/jhiphaze-0.0.1-SNAPSHOT.war
I have set this up as a service using systemctl. I am able to start | restart | etc.
I now have a need to debug into the application and would like to start the app up in debug mode. I read in the Spring Boot docs that I can place a file of the same base name with the extension of ".conf" and Spring Boot executable script will read the settings in the conf and start the app up with that. So I have a file:
/var/jhiphaze/jhiphaze-0.0.1-SNAPSHOT.conf
with the following line:
JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=y"
This has no effect on the run of the war, it starts up fine but does not listen and the console out indicates that the app is not listening on 8787 (or any port).
I also tried on my windows workstation, simply running from cli using:
java -jar jhiphaze-0.0.1-SNAPSHOT.war
in the project /build dir with the jhiphaze-0.0.1-SNAPSHOT.conf placed in the same directory. It is ignored there as well. The same argument in the conf file work at the cli:
java -jar -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=y jhiphaze-0.0.1-SNAPSHOT.war
works fine, pauses and waits for me to connect. Note that I used suspend=n for most of my attempts as I did not want the service start to fail while waiting for debugger to connect.
How can I get the executable war to recognize its partner .conf file?

How to have managed servers on different java JDK versions

I have multiple domains installed on a Windows Server 2008 R2 instance running WebLogic 12.1.2.
When I created the domains I set the runtime JDK to 1.7.
In each domain, I have an admin server (with no deployed applications) and 6-20 managed servers.
For the 2-10 managed servers that have a specific application deployed,
I want to change the JDK to 1.6.
How do I do this?
Note: we are trying to isolate a performance issue and want to know if the recent upgrade from 1.6 to 1.7 is causing issues. Once we know if it is, then we can try to find the code that 1.7 doesn't like. So we rebuilt (with 1.6) the one service application that has the issue and are re-running the (long running) tests to compare run times.
I tested this with Weblogic 12c today.
Update /u01/oracle/middleware/user_projects/domains/{DOMAIN_NAME}/bin/setDomainEnv.sh (Find setDomainEnv.sh under your {domain directory}/bin).
Change BEA_JAVA_HOME="" to BEA_JAVA_HOME="/u01/oracle/java/jdk1.8.0_51" (jdk1.8.0_51 is the new jdk home directory, your version may be different).
Update your managed server's "Server Start" configuration on the Weblogic admin console specifying the new Java Home:/u01/oracle/java/jdk1.8.0_51 and Java Vendor: Oracle.
Restart managed server.
ps -ef | grep {managed server name} from your *nix console to confirm the java version running your managed server.
Following these steps I could run other managed servers with the original jdk, while switching selected managed servers to run with jdk1.8.0_51.
Good luck!
I AM NOT SURE IF WLS 12.1.2 supports JDK1.6.
Go to your setDomainEnv.cmd file under DOMAIN_HOME/bin
BEA_JAVA_HOME="/path/to/jdk1.6"
export BEA_JAVA_HOME
SUN_JAVA_HOME="/path/to/jdk1.8"
export SUN_JAVA_HOME
if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
JAVA_HOME="${BEA_JAVA_HOME}"
export JAVA_HOME
else
if [ "${JAVA_VENDOR}" = "Sun" ] ; then
JAVA_HOME="${SUN_JAVA_HOME}"
export JAVA_HOME
else
JAVA_VENDOR="Sun"
export JAVA_VENDOR
JAVA_HOME="${SUN_JAVA_HOME}"
export JAVA_HOME
fi
fi
Then go to your Admin Console, go to Managed_server > Configuration > Server Start
Set JAVA_HOME and JAVA_VENDOR as you defined in setDomainEnv.cmd
You may set as many JAVA_HOME as you want by defining JAVA_HOME and JAVA_VENDOR in setDomainEnv.cmd. I myself have 4 different JDKs configured to be used by the same domain.
You may check the current JDK version that the managed server is running on by using admin console:
Go to managed_server > Monitoring > General

Can I use Java 8 on IBM's Bluemix Application Platform

I would like to use Java 8 features in Bluemix standalone java application, is this supported by default or do I need to alter some configuration?
You can ask for Java 8 with the default liberty buildpack by setting the following environment variable:
$ cf set-env myapp JBP_CONFIG_IBMJDK "version: 1.8.+"
See Customizing the JRE for additional details.
I don't know it's required, but I wouldn't leave such matters to the defaults. https://github.com/cloudfoundry/java-buildpack/blob/master/README.md#configuration-and-extension

Upgrade software that worked with Tomcat version 6 to work with version 7

I have Tomcat 6 on my Ubuntu. Under webapps I have software that was packed as XXX.war and it is now running with Tomcat 6. I need to install and to move it to work with Tomcat 7. How do I do this?
After you installed Tomcat 7 you can place all the xxx.war fils in:
path\Apache Tomcat - 7.x.xx\webapps
It is not actually necessary to restart the server. The hot deployment will take action and you will be able to access your applications.
You can see a complete migration guide here.

Resources