Created a TestNG suite and everything is working fine with Eclipse.
Problem starts when trying to run my suite with Jenkins.
Jenkins are hosted on one server having java version :
java version "1.7.0_151"
OpenJDK Runtime Environment (rhel-2.6.11.0.el6_9-x86_64 u151-b00)
OpenJDK 64-Bit Server VM (build 24.151-b00, mixed mode)
Suite Structure:
drwxrwxrwx. 11 jenkins jenkins 4096 Jul 10 03:21 .
drwxr-xr-x. 4 jenkins jenkins 4096 Jul 9 11:55 ..
drwxrwxrwx. 2 jenkins jenkins 4096 Jul 10 03:21 bin
-rwxrwxrwx. 1 jenkins jenkins 8985 Jul 10 03:21 .classpath
drwxrwxrwx. 4 jenkins jenkins 4096 Jul 10 03:21 dependencies
-rwxrwxrwx. 1 jenkins jenkins 19039 Jul 10 03:21 HelpText.xlsx
-rwxrwxrwx. 1 jenkins jenkins 39902 Jul 10 03:21 Import project in eclipse.docx
drwxrwxrwx. 2 jenkins jenkins 4096 Jul 10 03:21 lib
-rwxrwxrwx. 1 jenkins jenkins 302 Jul 10 03:21 log4j.properties
drwxrwxrwx. 3 jenkins jenkins 4096 Jul 9 11:55 Mac
-rwxrwxrwx. 1 jenkins jenkins 389 Jul 10 03:21 .project
-rwxrwxrwx. 1 jenkins jenkins 657005 Jul 10 03:21 selenium-java-2.53.1-srcs.jar
drwxrwxrwx. 2 jenkins jenkins 4096 Jul 10 03:21 .settings
drwxrwxrwx. 4 jenkins jenkins 4096 Jul 9 11:55 src
drwxrwxrwx. 2 jenkins jenkins 4096 Jul 10 03:21 TestExecutionLogs
-rwxrwxrwx. 1 jenkins jenkins 361 Jul 10 03:21 testng.xml
drwxrwxrwx. 6 jenkins jenkins 4096 Jul 10 03:21 test-output
drwxrwxrwx. 3 jenkins jenkins 4096 Jul 9 11:55 Win
Build command:
set
classpath=/var/lib/jenkins/workspace/testing/CC_Regression/bin;/var/lib/jenkins/workspace/testing/CC_Regression/lib/*
java org.testng.TestNG testng.xml
Build console Output:
+ set classpath=/var/lib/jenkins/workspace/testing/CC_Regression/bin
+ /var/lib/jenkins/workspace/testing/CC_Regression/lib/ant-1.7.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/ant-launcher-1.7.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/apache-mime4j-0.6.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/bsh-2.0b4.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/bson-3.0.4.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/cglib-nodep-2.1_3.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/commons-codec-1.10.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/commons-collections4-
4.1.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/commons-exec-
1.3.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/commons-io-2.4.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/commons-logging-1.2.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/curvesapi-1.04.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/extent-config.xml
/var/lib/jenkins/workspace/testing/CC_Regression/lib/extentreports-2.41.2.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/extentreports-3.0.1.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/Flash.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/freemarker-2.3.23.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/gson-2.3.1.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/guava-19.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/hamcrest-core-1.1.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/hamcrest-core-1.3.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/hamcrest-library-1.3.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/httpclient-4.5.1.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/httpcore-4.4.3.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/httpmime-4.5.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/jcommander-1.48.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/jna-4.1.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/jna-platform-4.1.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/jsoup-1.8.3.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/junit-4.10.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/junit-4.12.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/log4j-1.2.17.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/log4j-api-2.7.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/log4j-api-2.7-
javadoc.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/log4j-api-2.7-
sources.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/log4j.properties
/var/lib/jenkins/workspace/testing/CC_Regression/lib/mongodb-driver-
3.0.4.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/mongodb-driver-core-
3.0.4.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/netty-3.5.7.Final.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/phantomjsdriver-
1.2.1.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/poi-3.15.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/poi-examples-3.15.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/poi-excelant-3.15.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/poi-ooxml-3.15.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/poi-ooxml-schemas-
3.15.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/poi-scratchpad-3.15.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/selenium-java-
2.53.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/selenium-java-2.53.0-
srcs.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/selenium-server-
standalone-2.53.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/sikulixapi.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/sikulix.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/snakeyaml-1.15.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/sqlite-jdbc-
3.8.11.1.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/testng-6.9.9.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/xmlbeans-2.6.0.jar
/var/lib/jenkins/workspace/testing/CC_Regression/lib/ant-1.7.0.jar: line 1:
PK: command not found
/var/lib/jenkins/workspace/testing/CC_Regression/lib/ant-1.7.0.jar: line 2:
�9�5: command not found
/var/lib/jenkins/workspace/testing/CC_Regression/lib/ant-1.7.0.jar: line 3:
syntax error near unexpected token `K+:%���-
���������w�#����C��6jeJ'
/var/lib/jenkins/workspace/testing/CC_Regression/lib/ant-1.7.0.jar: line 3:
`�9�5�R����META-
INF/MANIFEST.MF�ϱN�0�ݒ���T$�uQ+u(K+:%���-
���������w�#����C��6jeJ)*�L*�;�q6��)�c�?
��3�k����\T���j7�c�U{j��F�X�u1n�o�N���ѱI#'
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Note: When trying with Locally installed Jenkins and all worked well.
Local system --> Java version details
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Please suggest
Related
I did everythin' like in Spring documentation to deploy my app on AWS. But got an error:
deploy-demo.service: Failed at step EXEC spawning /opt/deploy-demo/deploy-demo.jar: Exec format error
Sep 07 21:22:10 ip-172-31-45-166 systemd[1]: deploy-demo.service: Main process exited, code=exited, status=203/EXEC
My deploy-demo.service file located in /etc/systemd/system/deploy-demo.service with settings:
[Unit]
Description=deploy-demo
After=syslog.target
[Service]
User=gitlab-runner
ExecStart=/opt/deploy-demo/deploy-demo.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
deploy-demo.jar and deploy-demo.conf located in /opt/deploy-demo/
deploy-demo.conf file contains
RUN_ARGS="--spring.datasource.url=jdbc:postgresql://here_is_should_be_my_host:5432/helpfast --spring.datasource.username=postgres --spring.datasource.password=adminadmin"
All permissions seems to me correct:
drwxr-xr-x 2 gitlab-runner gitlab-runner 4096 Sep 7 21:21 ./
drwxr-xr-x 3 root root 4096 Sep 7 20:31 ../
-r-------- 1 gitlab-runner gitlab-runner 200 Sep 7 21:21 deploy-demo.conf
-r-x------ 1 gitlab-runner gitlab-runner 42645024 Sep 7 20:31 deploy-demo.jar*
Any ideas are highly appreciated!
Has anyone successfully got the HTTP/2 connector working in Tomcat9 on AIX (e.g. powerpc-ibm-aix7.2.5.0)?
I followed the instructions here to build the tcnative module (using tomcat-native-1.2.24-src that comes with Tomcat 9.0.37, APR 1.5.2, OpenSSL 1.0.2, IBM Java 1.8.0_261) i.e.
$ ./configure --with-apr=/opt/freeware/bin/apr-1-config --with-java-home=/app/java8_64/ --with-ssl=yes --prefix=/app/tomcat
followed by
make && make install
This creates the expected entries in /app/tomcat/lib, i.e.
-rw-r--r-- 1 usrxxx grpxxxx 3440287 Mar 03 16:47 libtcnative-1.a
-rwxr-xr-x 1 usrxxx grpxxxx 1057 Mar 03 16:47 libtcnative-1.la
lrwxrwxrwx 1 usrxxx grpxxxx 23 Mar 03 16:47 libtcnative-1.so -> libtcnative-1.so.0.2.24
lrwxrwxrwx 1 usrxxx grpxxxx 23 Mar 03 16:47 libtcnative-1.so.0 -> libtcnative-1.so.0.2.24
-rwxr-xr-x 1 usrxxx grpxxxx 1372146 Mar 03 16:47 libtcnative-1.so.0.2.24
but when Tomcat starts I get
04-Mar-2021 15:30:00.752 WARNING [main] org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native library failed to load. The error reported was [tcnative-1 (Not found in java.library.path)]
java.lang.UnsatisfiedLinkError: tcnative-1 (Not found in java.library.path)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1462)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1414)
at java.lang.System.loadLibrary(System.java:584)
at org.apache.tomcat.jni.Library.<init>(Library.java:69)
at org.apache.tomcat.jni.Library.initialize(Library.java:206)
at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:198)
...
04-Mar-2021 15:30:01.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.library.path=/app/java8_64/jre/lib/ppc64/compressedrefs:/app/java8_64/jre/lib/ppc64:/app/java8_64/jre/lib/ppc64/j9vm:/app/java8_64/jre/lib/ppc64:/app/java8_64/jre/../lib/ppc64:/app/java8_64/jre/lib/icc:/opt/freeware/lib:/opt/freeware/lib64:/usr/lib:/usr/lib64:/app/tomcat/lib:/usr/lib64:/usr/lib
...
04-Mar-2021 15:30:02.233 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]] org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
at org.apache.catalina.connector.Connector.initInternal(Connector.java:1024)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:533)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1057)
Edit - based on suggestions from Piotr and Lorinczy:
Tried adding tcnative-1.so as a symlink - same error
Copied libtcnative-1.* to the bin folder. Still failing but new error (progress!?). Possible 32bit v 64bit issue?
09-Mar-2021 10:10:07.116 WARNING [main] org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native library failed to load. The error reported was [/app/apache-tomcat-9.0.37/bin/libtcnative-1.a ( 0509-022 Cannot load module /app/apache-tomcat-9.0.37/bin/libtcnative-1.a.
0509-026 System error: Cannot run a file that does not have a valid format.)]
java.lang.UnsatisfiedLinkError: /app/apache-tomcat-9.0.37/bin/libtcnative-1.a ( 0509-022 Cannot load module /app/apache-tomcat-9.0.37/bin/libtcnative-1.a.
0509-026 System error: Cannot run a file that does not have a valid format.)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1462)
...
All the dependencies seem to be available
$ldd libtcnative-1.so.0.2.24
libtcnative-1.so.0.2.24 needs:
/usr/lib/libssl.so
/usr/lib/libcrypto.so
/opt/freeware/lib/libapr-1.so
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libc.a(shr.o)
/opt/freeware/lib/libgcc_s.a(shr.o)
/usr/lib/libcrypto.a(libcrypto.so.1.0.2)
/unix
/usr/lib/libpthreads.a(shr_comm.o)
/usr/lib/libcrypt.a(shr.o)
but the dump command seems to support the 32 v 64 bit theory:
$ dump -H -X64 libtcnative-1.so.0.2.24
libtcnative-1.so.0.2.24:
dump: libtcnative-1.so.0.2.24: 0654-108 file is not valid in the current object file mode.
Use the -X option to specify the desired object mode.
$ dump -H -X32 libtcnative-1.so.0.2.24
libtcnative-1.so.0.2.24:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x00000364 0x00000771 0x00000084
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x00000007 0x0000aacc 0x00006406 0x0000ab50
***Import File Strings***
INDEX PATH BASE MEMBER
0 /opt/freeware/lib:/usr/lib:/lib
1 libssl.so
2 libcrypto.so
3 libapr-1.so
4 libpthread.a shr_xpg5.o
5 libc.a shr.o
6 libgcc_s.a shr.o
It looks like only the 32-bit version of APR is currently available on the server also. I will update once I can get the 64-bit version installed.
Further Updates
The commands I am trying now are:
$ export CFLAGS=-maix64
$ export OBJECT_MODE=64
$ ./configure --with-apr=/opt/freeware/bin/apr-1-config_64 --with-java-home=/app/java8_64/ --with-ssl=/usr/include/openssl --prefix=/app/tomcat
$ make && make install
No errors but same outcome however. This doesn't seem to build a 64 bit version of the tomcat native module (if that is the issue).
I have recently updates my ubuntu deskto to 18.04. After this my tomcat is failing at startup. Each time I restart tomcat using the command service tomcat8 restart the log file give the following error -
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.get(LRUHybridCache.java:164)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:303)
... 135 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2268)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$3.run(ClassReflectionHelperUtilities.java:108)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$3.run(ClassReflectionHelperUtilities.java:104)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.secureGetDeclaredMethods(ClassReflectionHelperUtilities.java:104)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.getDeclaredMethodWrappers(ClassReflectionHelperUtilities.java:133)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.getAllMethodWrappers(ClassReflectionHelperUtilities.java:192)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.getAllMethodWrappers(ClassReflectionHelperUtilities.java:193)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperImpl$3.compute(ClassReflectionHelperImpl.java:84)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperImpl$3.compute(ClassReflectionHelperImpl.java:80)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
I then installed jdk8 and run update-alternatives command like this -
dimension:bin$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1101 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1101 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/bin/javac 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number:
dimension:bin$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number:
When I again restarted the tomcat, I saw the same error. Here are the contents to my jvm folder -
ls -lh /usr/lib/jvm/
total 8.0K
lrwxrwxrwx 1 root root 25 Apr 8 18:46 default-java -> java-1.11.0-openjdk-amd64
lrwxrwxrwx 1 root root 21 Aug 24 23:06 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
drwxr-xr-x 9 root root 4.0K Oct 4 10:56 java-11-openjdk-amd64
lrwxrwxrwx 1 root root 20 Oct 28 2016 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
drwxr-xr-x 7 root root 4.0K Oct 4 16:03 java-8-openjdk-amd64
My JAVA_HOME env is currently set to empty.
What should I do to fix my issue.
The java.base part of exception stack trace at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) suggests that you are still running with JDK 11.
Ensure that Tomcat 8 is running with JDK 8. Try debugging the Tomcat startup script with set -x to see how is the Java location determined, maybe it's set in /etc/default/tomcat8?
I am using STS since a long time and the only feature annoys me is, it creates a new Pivotal tc Server instance in every workspace created and I never use Pivotal tc.
Can anyone tell me how to completely remove Pivotal tc Server from STS installation?
I have tried to update the artifacts.xml file, bundles.info (equinox) and bluntly deleting the features for Pivotal tc but I've never got clean result.
Once you unzipped the distribution it should have a folder with tc-server in it. Simply delete that entire folder and STS will no longer try and create a tc-server install in your workspace.
For example in my installation it looks like this:
$ ls -la sts-bundle/
total 20
drwxrwxr-x 5 kdvolder kdvolder 4096 Oct 12 05:47 .
drwxr-xr-x 23 kdvolder kdvolder 4096 Nov 6 14:43 ..
drwxr-xr-x 2 kdvolder kdvolder 4096 Oct 11 04:03 legal
drwxr-xr-x 11 kdvolder kdvolder 4096 Oct 13 07:56 pivotal-tc-server-developer-3.2.8.RELEASE
drwxr-xr-x 9 kdvolder kdvolder 4096 Nov 3 15:41 sts-3.9.1.RELEASE
So simply delete the folder pivotal-tc-server-developer-3.2.8.RELEASE.
I'm trying to run an Apache Hive web interface, so I downloaded the lastest version of ant (Ant 1.9.4), and when I execute the command to produce the hive.war file
ANT_LIB=/opt/ant/lib bin/hive --service hwi
I get the following error:
cp=/tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp
cp=null
work dir=/tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp
extension dir=/usr/lib/jvm/jdk1.7.0_65/jre/lib/ext:/usr/java/packages/lib/ext
srcDir=/tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp
compilerTargetVM=1.5
compilerSourceVM=1.5
include=org/apache/jsp/index_jsp.java
15/02/23 09:56:59 ERROR compiler.Compiler: Error compiling file: /tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp//org/apache/jsp/index_jsp.java [javac] warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
15/02/23 09:56:59 ERROR mortbay.log: /hwi/
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/jdk1.7.0_65/jre"
at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:130)
at org.apache.tools.ant.taskdefs.Javac.findSupportedFileExtensions(Javac.java:984)
at org.apache.tools.ant.taskdefs.Javac.scanDir(Javac.java:961)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:932)
at org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:220)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
I'm executing that code as root. My JAVA_HOME is correctly set at the .bashrc:
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_65
export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec
export HADOOP_CONF_DIR=/etc/hadoop/conf
export PATH=$PATH:$JAVA_HOME/bin
and .bash_profile files:
.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_65
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export PATH
I want to know why is Ant referencing the javac at "/usr/lib/jvm/jdk1.7.0_65/jre". Moreover, here is my JDK structure:
[root#ip-10-32-205-19 ~]# cd $JAVA_HOME
[root#ip-10-32-205-19 jdk1.7.0_65]# ls -l
total 19760
drwxr-xr-x. 2 root root 4096 Feb 23 04:09 bin
-r--r--r--. 1 root root 3339 Jun 17 2014 COPYRIGHT
drwxr-xr-x. 4 root root 4096 Jun 17 2014 db
drwxr-xr-x. 3 root root 4096 Jun 17 2014 include
drwxr-xr-x. 5 root root 4096 Jun 17 2014 jre
drwxr-xr-x. 5 root root 4096 Feb 23 04:09 lib
-r--r--r--. 1 root root 40 Jun 17 2014 LICENSE
drwxr-xr-x. 4 root root 4096 Jun 17 2014 man
-r--r--r--. 1 root root 114 Jun 17 2014 README.html
-rw-r--r--. 1 root root 499 Jun 17 2014 release
-rw-r--r--. 1 root root 19902785 Jun 17 2014 src.zip
-rw-r--r--. 1 root root 110114 Jun 16 2014 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r--. 1 root root 173559 Jun 17 2014 THIRDPARTYLICENSEREADME.txt
which shows I have the JDK, and not only the JRE installed. I also took a look at similar questions, but none could solve my problem. The Java is 64bits, plus I also ran source for both .bashrc and .bash_profile.
The error message says:
Perhaps JAVA_HOME does not point to the JDK. It is currently set to
"/usr/lib/jvm/jdk1.7.0_65/jre"
However, your .bashrc has:
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_65
You likely need to run source ~/.bashrc in your Bash shell to reset JAVA_HOME to the root of your JDK installation. Then run Ant again.