Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » After successful build at the comand line I get Eclipse error JVM terminated. Exit code=1[SOLVED]
After successful build at the comand line I get Eclipse error JVM terminated. Exit code=1[SOLVED] [message #1841257] Sat, 08 May 2021 10:49 Go to next message
don don2 is currently offline don don2Friend
Messages: 4
Registered: May 2021
Junior Member
I am using eclipse IDE for C/C++ Developers (includes Incubating components) Version: 2021-03 (4.19.0) Build id: 20210312-0638

I am using it on lubuntu 20.10 64bit.

I have also installed java11 as part of trying to resolve the issue: openjdk 11.0.11 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.10) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.10, mixed mode, sharing)

The eclipse GUI works just fine and I am able to compile my code. I am interested to compile the eclipse project via the command line(So I can run it as part of a CI pipeline).

When I compile it via the command line my build is successful and I get a binary. the problem is I am getting "JVM terminated. Exit code=1" which make my pipeline to fail.

This is the command I use to compile:
./eclipse -nosplash --launcher.suppressErrors  -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import /<path_to_project>/ -data /<eclipse_work_space> -build <project_name>/Debug


This is the full error message I get once compiling is done:
Eclipse:
JVM terminated. Exit code=1
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dsun.java.command=Eclipse
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
-jar /home/drone/eclipse/cpp-2021-03/eclipse//plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
-os linux
-ws gtk
-arch x86_64
-launcher /home/drone/eclipse/cpp-2021-03/eclipse/eclipse
-name Eclipse
--launcher.library /home/drone/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.100.v20210209-1541/eclipse_11301.so
-startup /home/drone/eclipse/cpp-2021-03/eclipse//plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
--launcher.appendVmargs
-exitdata 20
-product org.eclipse.epp.package.cpp.product
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import /home/drone/azure_agent/_work/1/s/projects/RT-Linux/
-data /var/tmp/ee
-build linux_sim/Debug
-vm /usr/lib/jvm/java-11-openjdk-amd64/bin/java
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dsun.java.command=Eclipse
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
-jar /home/drone/eclipse/cpp-2021-03/eclipse//plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar 


This is the eclipse.ini file:
-startup
plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
--launcher.library
/home/drone/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.100.v20210209-1541
-product
org.eclipse.epp.package.cpp.product
-showsplash
/home/drone/.p2/pool/plugins/org.eclipse.epp.package.common_4.19.0.20210311-1200
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dsun.java.command=Eclipse
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/


I did a search before posting but found no mention of this issue when compiling via the command line(while GUI works just fine).

I will be perfectly fine with a way to suppress this error(so my pipeline won't fail because of it) if it won;t suppress compilation errors during the build.

[Updated on: Mon, 10 May 2021 18:41]

Report message to a moderator

Re: After successful build at the comand line I get Eclipse error JVM terminated. Exit code=1 [message #1841260 is a reply to message #1841257] Sun, 09 May 2021 17:36 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
When I get an exit code JVM terminated. Exit code=1
it is preceded by an actual error message:

Quote:

Project: file:<whatever> can't be found!
Warning: Nashorn engine is planned to be removed from a future JDK release
Saving workspace.
Eclipse:
JVM terminated. Exit code=1

Quote:

Workspace already in use!
Eclipse:
JVM terminated. Exit code=1

[Updated on: Sun, 09 May 2021 17:41]

Report message to a moderator

Re: After successful build at the comand line I get Eclipse error JVM terminated. Exit code=1 [message #1841276 is a reply to message #1841260] Mon, 10 May 2021 18:40 Go to previous messageGo to next message
don don2 is currently offline don don2Friend
Messages: 4
Registered: May 2021
Junior Member
I have solved my issue, so for posterity I will explain my specific issue but mostly I strive to provide a more general explanation of what may be the cause of "JVM terminated. Exit code=1" when using eclipse in heedless mode via the CLI. This is one of possible reasons(most threads dealing with this error attribute it to insufficient memory values, set at the eclipse.ini file).

The root of all evil is the way eclipse communicates errors. In the best case eclipse will abort the build and state explicitly what had happened(and unfortunately David Vavra answer came after I already solved the issue and might have saved me some time otherwise)):
Quote:

Project: file:<whatever> can't be found!
Warning: Nashorn engine is planned to be removed from a future JDK release
Saving workspace.
Eclipse:
JVM terminated. Exit code=1


Quote:

Workspace already in use!
Eclipse:
JVM terminated. Exit code=1


And in the worst case, not only eclipse doesn't state what went wrong it will state that everything was just fine. In my case eclipse sent to the stdout:

Quote:

Finished building target: linux_sim

15:20:20 Build Finished. 0 errors, 11 warnings. (took 9m:18s.202ms)

Eclipse:
JVM terminated. Exit code=1


So in my specific case I have a Debug build and a Release build as part of my eclipse project . I use a toolchain for cross compilation and all of my builds are compiled with the Debug settings while Release is left unmaintained. A long time a go I have moved from toolchain X to Y but didn't updated the "path" and "prefix" for the Release settings and removed the deprecated toolchain from my machine. This work just fine when I use the GUI.

Once I used eclipse in a heedless mode I explicitly stated that I would like to compile with Debug settings only by stating -build <project_name>/Debug and eclipse did compile only the Debug settings.

from the command line:
Quote:

15:11:02 **** Build of configuration Debug for project linux_sim ****


There is no mention of:
Quote:

**** Build of configuration Release for project linux_sim ****

for project linux_sim anywhere during my build.

Although I explicitly stated that I want to compile only the Debug configuration and although eclipse complied with my request it did try to load the settings for Release and when scrolling all the way to the start of the build process I noticed this two lines:
Quote:

Unable to find full path for "arm-poky-linux-gnueabi-gcc"
Unable to find full path for "arm-poky-linux-gnueabi-g++"


Once I cleaned the Release configuration from the "prefix" and "path" of the deprecated toolcahain "JVM terminated. Exit code=1" issue was gone.

The real beauty of this issue (besides eclipse loading settings it should not have loaded)is that although "Unable to find full path for "arm-poky-linux-gnueabi-gcc"" qualified as a reason to send to the stdout a "JVM terminated. Exit code=1" message eclipse didn't abort the build process and allowed it to finish with a "success" message and only then sent the "JVM terminated. Exit code=1" message to the stdout without providing any reason as to why.

[Updated on: Mon, 10 May 2021 18:44]

Report message to a moderator

Re: After successful build at the comand line I get Eclipse error JVM terminated. Exit code=1 [message #1841282 is a reply to message #1841276] Tue, 11 May 2021 03:40 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
A lot depends on what generated the actual error.
JVM terminated. Exit code=1 just means something went wrong.
It's similar to Make's make: *** Error 1
It's caused by a subprocess returning a non-zero exit code.


I tried a headless build of the Debug configuration of a simple project using 2019-09
where the Debug configuration was GCC and the Release configuration was a cross-compile with a bad prefix.
It worked just fine with JVM exiting normally.

I tried it with 2021-03 and that also worked.

You may have uncovered a bug.
Submit a bug report if you can recreate it with a minimal example.

UPDATE:

  • I realized that the Release configuration had never been created
    so I forced it with a build (this is a Managed Build project)
    then reran the headless build.
    Same result.
  • I am doing a -cleanBuild vs -build
  • I tried it with and without the -import <project path>


[Updated on: Tue, 11 May 2021 04:23]

Report message to a moderator

Previous Topic:Referenced projects building
Next Topic:Manage build configuration list
Goto Forum:
  


Current Time: Tue Apr 16 15:14:37 GMT 2024

Powered by FUDForum. Page generated in 0.39626 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top