ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportACE - Specify java source level for mqsicreatebar

Post new topicReply to topic
ACE - Specify java source level for mqsicreatebar View previous topic :: View next topic
Author Message
lfrestrepog
PostPosted: Thu Feb 06, 2020 11:18 am Post subject: ACE - Specify java source level for mqsicreatebar Reply with quote

Novice

Joined: 08 Jul 2014
Posts: 11

Hello, good day.

I'm facing a funny problem here, perhaps somebody knows a solution:

I have an application with java compute nodes and some dependencies in static libraries (also java classes). In one method there is a lambda, which should work just fine as ACE comes with jre 1.8 built in...

It does work, but only if the bar file is created manually from the toolkit, when we try to create it with mqsicreatebar command it fails with the following error:

Code:

[2020/02/06/11:46:38] [INFO] CommandProcessor: process { Check the workspace error }
[2020/02/06/11:46:38] [ERROR]  { Workspace has errors on it after the build. In order to create bar there should be no errors on the workspace. }  - com.ibm.etools.mft.bar.cmdline.MqsiCreateBarException: Workspace has errors on it after the build. In order to create bar there should be no errors on the workspace.
BIP0965E Error compiling files in mqsicreatebar.

The message is:
Workspace has errors on it after the build. In order to create bar there should be no errors on the workspace.


Problem markers list from the workspace:
        Problem 0: Resource - .../PEQHelper.java; Error message - Cannot refer to the non-final local variable node defined in an enclosing scope.
        Problem 1: Resource - .../PEQHelper.java; Error message - Lambda expressions are allowed only at source level 1.8 or above.
        Problem 2: Resource - .../PEQHelper.java; Error message - Cannot refer to the non-final local variable node defined in an enclosing scope.



If I modify the java project settings to override workspace defaults (even though all settings are the same), the bar file is created successfully. But we do not include .settings directory in our version control (nor .metadata or the like).

Does anyone know how to tell mqsicreatebar command to use java source level 1.8?

I'm using windows, but we did try on a linux setup with no better luck (because we have a rule of blaming windows first). Also, tried ACE versions 11.0.0.7 and 11.0.0.4 (just in case that's relevant information).

Thanks a lot.
_________________
--
Luis Fernando Restrepo Gutirrez
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 07, 2020 1:36 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20216
Location: LI,NY

did you specify JAVA_HOME and make sure it points to a Java 8 installation (the one of the toolkit?)
Did you specify some JAVA_OPTIONS in the environment?

If you just type
Code:
java -version
what is the output?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
lfrestrepog
PostPosted: Fri Feb 07, 2020 4:41 am Post subject: Reply with quote

Novice

Joined: 08 Jul 2014
Posts: 11

Hi.

JAVA_HOME points to "C:\Program Files\IBM\ACE\11.0.0.7\common\jdk" (I did try pointing it to my local openjdk install too). Here's the output of java -version:

Code:

java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 8.0.5.35 - pwa6480sr5fp35ifix-20190524_01(SR5 FP35+IJ15979))
IBM J9 VM (build 2.9, JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20190524_417294 (JIT enabled, AOT enabled)
OpenJ9   - 321e430
OMR      - 16b77d7
IBM      - 72459d3)
JCL - 20190409_01 based on Oracle jdk8u211-b25


On the other hand, JAVA_OPTIONS is not defined, so I'll tinker with it a bit and report back.

Thanks.
_________________
--
Luis Fernando Restrepo Gutirrez
Back to top
View user's profile Send private message
lfrestrepog
PostPosted: Fri Feb 07, 2020 6:16 am Post subject: Reply with quote

Novice

Joined: 08 Jul 2014
Posts: 11

So, we tried different settings in _JAVA_OPTIONS, trying to override source (for javac) or org.eclipse.jdt.core.compiler.source. We also tried setting IBM_JAVA_OPTIONS environment variable to different values. Yet, the build stills fails.

Any other advise would be appreciated.

Thanks.
_________________
--
Luis Fernando Restrepo Gutirrez
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 07, 2020 7:09 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20216
Location: LI,NY

As you don't have the .settings, check how you specify in eclipse the source code level and target code level. If you can pass that information to the project I believe you'll be fine.

Try specifying in the java options
Code:
-Dorg.eclipse.jdt.core.compiler.source="1.8"

Alternativly copy the org.eclipse.jdt.core.prefs file from the .settings directory...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
lfrestrepog
PostPosted: Mon Feb 10, 2020 4:59 am Post subject: Reply with quote

Novice

Joined: 08 Jul 2014
Posts: 11

So, after different experiments we decided to go with the .settings directory approach... We are still interested in alternatives, should anyone have a better idea.

Thanks a lot.
_________________
--
Luis Fernando Restrepo Gutirrez
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportACE - Specify java source level for mqsicreatebar
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.