Closed TrippyLighting closed 6 years ago
Update: comment below not completely correct. Read on.
Stock Sloeber 4.1 will not work with java 9 because it is not based on the latest Eclipse but you can get it running by following these instructions [1].
Alternatively you can install CDT (Eclipse C tooling) Oxygen 1a [2] and install the Sloeber 4.1 stable plugins [3]
or just install a Sloeber SDK from the nightly [4]
[1] https://waynebeaton.wordpress.com/2017/09/25/running-eclipse-ide-on-java-9/ [2] https://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/oxygen1a [3] http://eclipse.baeyens.it/stable.php [4] https://oss.sonatype.org/content/repositories/snapshots/com/github/brodykenrick/arduino-eclipse-plugin/io.sloeber.product/4.1.0-SNAPSHOT/
I finally got it to work by installing the nightly Sloeber 4.2. However, I had to uninstall Java 9 (after installing JDK 8) for that to work, otherwise I still did receive the same error message. Thanks for the help.
Did you install the plugins in your own Eclipse? Sloeber IDE ships with its own JRE. It should never give problems.
No, I downloaded the nightly product. This is also on a new Mac Book Pro with a basically out-of-the-box fresh installation of macOS Sierra now High Sierra. So there has not been any previous installation of Java.
I was not aware that this should not be necessary. I was the first user that used the Arduino Eclipse paging with Teensy boards and had to install Java with previous versions of the Arduino Eclipse plugins. So It seemed just natural to me having to do it ;-)
Also following the instructions on Sloeber.io first installed the newest JRE 9 from the Oracle web site. When this di not work I re-read the instructions and there is a warning that it might be better to install the full SDK so I installed JDK 9 and now JDK 8.
If I run:
% Java -version
I get:
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
Ah you are running on mac. I'm not sure if the mac distribution includes the jre. However, what worries me is that you are not able to run the nightly on java 9. I will look into that.
Should we re-open the issue ?
Yes
Are you getting the same issue or a different issue? My tests show that 4.1 can run on java 9 with the caveats I published on my first comment.
However, I do run in an issue caused by an old gson library. Are you looking at the same one?
java.lang.NoClassDefFoundError: java/sql/Time
at com.google.gson.Gson.
Sloeber 4.1 will not work with java 9. Sloeber nightly 4.2 before november 18 2017 will work on java 9 if you add the following line to the -vmargs section of the file sloeber-ide.ini:
--add-modules=ALL-SYSTEM
I will add this setting to the default settings so that future nightlies are fine.
Nightlies should be running fine on java 9 from this point forward
Thanks Wim :-)
I can confirm that this works with the nightly. However, there is some "stuff" left that can easily confuse users.
io.sloeber.product-4.1.0-20171110.002936-136-macosx.cocoa.x86_64.tar.gz
but the splash screen reads "Sloeber Beryllium 4.2"Now I've only one problem left. I've been able to compile older projects, but they show a lot of unresolved references of libraries. I've come across this before but don't remember what the fix was.
Anyway, thanks again for the help!
Found it! Everything works now.
The 4.2 version thing is because we're in the process of releasing 4.2. The splash has been updated before the version numbers (I updated the version numbers on 18 Nov so it is in the build of 19 Nov).
This makes that the latest nightly is from Nov 19 and is located at https://oss.sonatype.org/content/repositories/snapshots/com/github/brodykenrick/arduino-eclipse-plugin/io.sloeber.product/
4.2.0-SNAPSHOT/
Sloeber.io points to https://oss.sonatype.org/content/repositories/snapshots/com/github/brodykenrick/arduino-eclipse-plugin/io.sloeber.product/
4.1.0-SNAPSHOT/
for the nightly. Here you can find the latest 4.1 nightly Nov 10
So basically the version you downloaded io.sloeber.product-**4.1.0**-2017**1110**.002936-136-macosx.cocoa.x86_64.tar.gz
does not contain the fix Wim has provided :-s
It however does contain a newer eclipse version which solves other java 9 issues.
Note that the version you now have supports auto library install. Make sure you're cdt settings are correct or you may install plenty of unwanted libraries. This is why you get the warning screen if the cdt settings are set on "maximal discovery" and not on "strict code discover".
Would you be willing to share what was needed to fix?
As to java JRE versus JDK As to licences we can package the jre but not the jdk. For windows the jre has been sufficient but I can't speak for mac. The nightly does not contain the jre. I can't even recall how I added the jre's.
To get Sloeber nightly to install I needed to add:
--add-modules=ALL-SYSTEM
to the -vmargs section of the file sloeber-ide.ini as suggested by @wimjongman
The issue with the unresolved references seems to stem from indexer issues. When I install sloeber I get this warning:
The indexer option "index source files not included in the build" must be off in windows->preferences->C/C++->indexer
and
The indexer option "index unused headers" must be off in windows->preferences->C/C++->indexer
Sloeber might still function but if you get strange results you know where to look.
Do not create an issue if you see this!!!
So I disabled these and while my code compiled (have not tried uploading to a Teensy yet) there are a lot of unresolved references.
When I re-enable the settings these unresolved references disappear, but therefore I get the warning message again. Catch 22 ?
As to JRE vs. JDK, I've always had to install the JDK on macOS. I understand the licensing issue. It might be interesting to ask other mac users for their experience and if this is consistent to update the documentation.
So I disabled these and while my code compiled (have not tried uploading to a Teensy yet) there are a lot of unresolved references.
This is strange. Have you tried to rebuild the index?
to the -vmargs section of the file sloeber-ide.ini as suggested by @wimjongman
This explains as Wim his fix is exactly doing this.
@TrippyLighting I think that if the issue you have with the indexer is real it is a showstopper for release 4.2. Can you make sure the indexer does not resolve? Note that while the indexer is rebuilding there will be unresolved items. Give the indexer some time. Here are the settings as they should be. The marked ones are the not default ones.
Now that the indexer had some time it seems to work OK. I do have a minor difference in my settings compared to your screenshot above. You have "Use active build configuration" enabled. My default is "Use build configuration specified in the project's indexer settings" Here is how my settings look at the moment.
That is a relieve:-) The "build configuration for the indexer" is only important if you use multiple configurations.
I posted this on the Arduino Forum as well but have received no response.
On my iMac I currently use Slober 3.1 (ancient) and an even more ancient version 1.30 of Teensyduino.
I installed Sloeber 4.1 (stable) on my new MacBook Pro and the latest Java JDK 9, which I realize is one step ahead of what is documented on the sloeber.io website, which is 8 but I've installed higher java versions before and it's never been a problem.
I can start Sloeber and it asks for a work space directory, but when I accept the default it responds with the error message:
An error has ocurred. See the log file
Here's the log file output: