1

I have created a java adapter but it building it fails while building javascript adapters works.

This is my setup:

  • java version "1.7.0_101"
  • OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.14.04.1)
  • OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
  • JAVA_HOME is /usr/lib/jvm/java-7-openjdk-amd64
  • OS: linux x64

I have already tried this workaround.

[Error: 
BUILD FAILED
/opt/ibm/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:206: Build of the adapter 'xxxxxx' failed. The failure message is: 'Compile failed; see the compiler error output for details.'. The failure may have been caused due to incorrect Java code, incompatible JDK level, JAVA_HOME not pointing to the location of a valid JDK or missing dependencies. Note that the worklight-jee-library.jar must be in the classpath when building Java adapters.
]
Error: Sorry an error has occurred. Please check the stack above for details.
Community
  • 1
  • 1
Najeeb P
  • 81
  • 6

1 Answers1

1

The error message specifies the following possible problems:

  1. Code problem
  2. Java path problem

So, if we suspect that we've placed the Java in the right place and that we're using the correct Java version, then I suggest to look at your Java code.

Create a new Java adapter and make no changes in it, rather simply and only create it and build it. See if it passes the build step. If it does, then you need to go back to your existing Java adapter and see why it fails - possibly due to the first option - some code problem.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • `code` mfp add adapter [?] What do you want to name your MobileFirst Adapter? testJava [?] What type of adapter would you like? Java [?] Enter Java Package for this adapter: com.testjava A new java Adapter was added at /home/xx/adapters/testJava `code` i got same issue – Najeeb P Dec 03 '16 at 08:14