Compile with Java 10: is it possible at all?

40 views
Skip to first unread message

Sebastian Sardina

unread,
Oct 12, 2018, 11:50:08 PM10/12/18
to sarl
I know that the current version assumed is Java SE 8, but is there any way to setup the pom.xml to make it work with Java SE 10, using source and target.

I added this but did not work:

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>


Maven complains that 

[ERROR] Source option 5 is no longer supported. Use 6 or later.


Thanks

Sebastian

Stéphane Galland

unread,
Oct 13, 2018, 2:19:59 AM10/13/18
to sa...@googlegroups.com
Dear Sebastian.

Xtext libraries (which is the base library for building SARL tools) are officially compatible with Java 9 and 10 (https://www.eclipse.org/Xtext/releasenotes.html).

Consequently, SARL compiler should be also. Unfortunatelly, we have not yet tested and validated this evolution (see https://github.com/sarl/sarl/issues/834).


Regarding your issue, you have to be sure that the variables you have declared are used there:
<plugin>
<groupId>io.sarl.maven</groupId>
<artifactId>sarl-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>

And I recommend to change the configuration of the Java compiler too:

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>


In case of problem, you could put the details on the SARL issue above for helping us to help you.

All the best.
Stéphane.
--
You received this message because you are subscribed to the Google Groups "sarl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sarl+uns...@googlegroups.com.
To post to this group, send email to sa...@googlegroups.com.
Visit this group at https://groups.google.com/group/sarl.
To view this discussion on the web visit https://groups.google.com/d/msgid/sarl/1512b38e-eb2f-4311-9cc2-0bfa3bb4613f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

http://le2i.cnrs.fr/

Laboratoire Informatique Électronique, Informatique et Image
LE2I EA 7508

http://www.utbm.fr

Prof. Dr. Stéphane GALLAND
Full Professor of Computer Science and Multiagent Systems

http://www.ubfc.fr

Head of the LE2I's Axis on "Smart Environments"
French Head of ARFITEC ARF-17-10 "Energy, Transport, Industry, Challenges for tomorrow"
Senior member of the Multiagent Group
Member of IEEE
Member of AFIA

http://www.multiagent.fr Université de Technologie de Belfort-Montbéliard
13, rue Ernest Thierry-Mieg
90010 Belfort Cedex, FRANCE
Web: http://www.multiagent.fr/People:Galland_stephane
Phone: +33 384 583 418 (work office)
Mobile: +33 662 274 442 (private)

Sebastian Sardina

unread,
Oct 15, 2018, 6:30:03 AM10/15/18
to sarl
Hi Stephane,

Thanks for this, sorry for the delay, I was trying several things and was busy with other stuff.

So I have Java SE 10 and SARL 0.8.4. I have your recommendations on the pom.xml but I get a long trace of error when compiling..

I attach the compile output and pom.xml, not sure if they can tell you something.. Not to me, but you are the ninja here... ;-)

Notice SARL_VERSION env variable is set to 0.8.4

Also ECLIPSE complains a lot when I set to use SUN Oracle 10, see screenshot:

Screenshot from 2018-10-15 21-27-52.png





but it seems like Java SE 10 is very different from Java SE 8, there is no jre/ subdir for example and it is based on modules rather than jar files (whatever that means)....

mmmmm I am very lost here...
error-mvn-package.txt
pom.xml

Sebastian Sardina

unread,
Oct 15, 2018, 6:32:14 AM10/15/18
to sarl
Sorry, I attach screenshot here as the image seems to come way too small in the post...
Screenshot from 2018-10-15 21-27-52.png

Stéphane Galland

unread,
Oct 16, 2018, 8:44:12 AM10/16/18
to sarl
Dear Sebastian.

Thank you for the files. They are very valuable.
They indicate that there is a problem with the class format (since several errors are related to the loading of the class files from the Java API itself).

I will explore this issue, first by moving from Java 8 to Java 9, and then by moving to Java 10.

Stéphane.

Sebastian Sardina

unread,
Oct 17, 2018, 4:16:57 AM10/17/18
to sarl
Great, glad it helped.

You can always just clone this repo and try mvn clean package:



Just set env variable SARL_VERSION to 0.7.2  or 0.8.4

It works with Java 8. Does not work with Java 10. Did not try with Java 9, but I' ve ready Java 9 is not going to be long-term:

Stéphane Galland

unread,
Oct 17, 2018, 4:49:34 AM10/17/18
to sarl
Thank you. I will use your project as one of the benchs for my tests.

I will test both of Java 9 and Java 10 because we cannot force the SARL developers to use Java 10 yet. I have to validate if the Xtext framework is really compatible with these versions.

It is a very important decision to choose the minimum (and maximum) requirements for SARL. I will discuss with Sebastian Rodriguez on this point.
But do not expect a major change into the Java 10 support before the official release date of the version 0.9 (March 2018).

Stephane.

Sebastian Sardina

unread,
Oct 17, 2018, 7:05:03 AM10/17/18
to sarl
I am OK and I use Java SE 8. 

I just needed to try SWI JPL in Java 10 to check for warnings at compile time, and while I had 10 installed I thought I would give it a try to compile my SARL projects.

Given that I got what you saw, I thought it would be useful to at least put it on record.

I have now removed Java SE 10 and went back to my 8 version, dont worry.

Thanks for clarifying though...
Reply all
Reply to author
Forward
0 new messages