How to implement the C/C++ dev environment Eclipse

Hi guys,

I’ve installed the eclipse IDE. But I only c the Java environment.

How to get the C/C++?

Hello In_Control01,

There’s no openSUSE package for it.
But you can install it in eclipse self.
Start eclipse->Help->Software Updates.
Select the tab “Available Software” and click on the button “Add Site”.
And enter this url:

http://download.eclipse.org/tools/cdt/releases/ganymede/

Now you can install the CDT plugin.

Good luck!:wink:

When I click install in eclipse->update for the packages. It want install anything.

No progressing tab.

Hello In_Control01,

Make sure you have selected “CDT Main Features”.
And click on install:
http://i40.tinypic.com/euq3bp.png
A new window will open.
Then click on finish and it will install.

Good luck!:wink:

Yes, but there is no other window that opens?

I’m missing some Java dependencies?

Hello In_Control01,

Do you mean that the button is pressed but nothing happens?
Maybe you have encounterd this bug:
So try starting eclipse with this command:

GDK_NATIVE_WINDOWS=true eclipse

And try it again.

Good luck!:wink:

Then I get this error.

(.:7855): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(.:7855): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(.:7855): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

(.:7855): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(.:7855): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(.:7855): Gdk-CRITICAL **: gdk_screen_get_display: assertion `GDK_IS_SCREEN (screen)' failed

(.:7855): Gdk-CRITICAL **: gdk_display_get_pointer: assertion `GDK_IS_DISPLAY (display)' failed

(.:7855): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(.:7855): Gdk-CRITICAL **: gdk_screen_get_n_monitors: assertion `GDK_IS_SCREEN (screen)' failed

(.:7855): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(.:7855): Gdk-CRITICAL **: get_monitor: assertion `GDK_IS_SCREEN (screen)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x902443c9, pid=7855, tid=3067235184
#
# JRE version: 6.0-b16
# Java VM: OpenJDK Client VM (14.0-b16 mixed mode linux-x86 )
# Distribution: Custom build (Sun Nov  1 09:17:31 UTC 2009)
# Problematic frame:
# C  [libgdk-x11-2.0.so.0+0x5f3c9]  gdk_screen_get_monitor_geometry+0x19
#
# An error report file with more information is saved as:
# /home/mymachine/hs_err_pid7855.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Hello In_Control01,

I see you use openJDK.
I used openJDK for a while, but it didn’t work that well.
Some java programs worked and some didn’t.
So I would recommend to uninstall openJDK and install these packages:

  • java-1_6_0-sun
  • java-1_6_0-sun-plugin
  • java-1_6_0-sun-devel (You probably need this for eclipse)

Good luck!:wink:

Edward, how do I uninstall the openJDK?

Hello In_Control01,

Open YaST->Software->Software Management.
Search for “java-”.
Select the package java-1_6_0-sun and java-1_6_0-sun-plugin (needed for firefox).
After that deselect all the packages beginning with java-1_6_0-openjdk.

Good luck!:wink:

Edward, the sun version give me same error?

Hello In_Control01,

That is very strange.
When do you get this error.
When you start eclipse? When you press the Install button?
And which version of openSUSE do you have?
Do you use KDEor GNOME?

You can also run eclipse without “GDK_NATIVE_WINDOWS=true”.
Only then you need to press the button like this;

  1. Press the button. (You’ll get focus but nothing else happens)
  2. And when you have focus press enter.

Good luck!:wink:

When I start Eclipse with GDK_NATIVE_WINDOWS=true eclipse.

And which version of openSUSE do you have?
Linux 2.6.31.5-0.1-desktop #1 SMP PREEMPT 2009-10-26 15:49:03 +0100

Do you use KDEor GNOME?

KDE4

I can install now by pressing enter on install button. But now I get an error while installing.

The error occurred while collecting items to be installed.

Hello In_Control01,

What’s the error message?
Is it the same as before?

Best of luck!:wink:

Edward
No, the one before was an error in the CLI and eclipse did not start with this GDK_NATIVE_WINDOWS=true eclipse.

Now I get an error in eclipse itself while installing the CDT package.
**An error occurred while collecting items to be installed

java.lang.NullPointerException
**

Hello In_Control01,

I suddenly got the same error.
This is how I solved it:

  1. Delete the content of the folder /home/<USER>/.eclipse (This will delete you eclipse configurations!)
  2. Start eclipse and add CDT Ganymede Releases Update Site.
  3. Select CTD and press install.

I hope this also works for you.

Best of luck!:wink:

I think im almost there.
I removed the eclipse config and try to install the CDT package again.

An error occurred while collecting items to be installed
  No repository found containing: org.eclipse.cdt/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.core/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.core.linux/osgi.bundle/5.0.0.200902130801
  No repository found containing: org.eclipse.cdt.core.linux.x86_64/osgi.bundle/5.0.0.200902130801
  No repository found containing: org.eclipse.cdt.debug.core/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.debug.mi.core/osgi.bundle/5.0.1.200902130801
  No repository found containing: org.eclipse.cdt.debug.mi.ui/osgi.bundle/5.0.1.200902130801
  No repository found containing: org.eclipse.cdt.debug.ui/osgi.bundle/5.0.1.200902130801
  No repository found containing: org.eclipse.cdt.doc.isv/osgi.bundle/5.0.1.200902130801
  No repository found containing: org.eclipse.cdt.doc.user/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt/org.eclipse.update.feature/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.gnu.build/org.eclipse.update.feature/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.gnu.build.source/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.gnu.debug/org.eclipse.update.feature/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.gnu.debug.source/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.launch/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.make.core/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.make.ui/osgi.bundle/5.0.1.200902130801
  No repository found containing: org.eclipse.cdt.managedbuilder.core/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.managedbuilder.gnu.ui/osgi.bundle/5.0.0.200902130801
  No repository found containing: org.eclipse.cdt.managedbuilder.ui/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.platform/org.eclipse.update.feature/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.platform.source/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.platform.source/org.eclipse.update.feature/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.platform.source.linux.gtk.x86_64/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.sdk/osgi.bundle/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.sdk/org.eclipse.update.feature/5.0.2.200902130801
  No repository found containing: org.eclipse.cdt.ui/osgi.bundle/5.0.2.200902130801

Hello In_Control01,

Which version of eclipse do you have?
You can see this by opening eclipse->Help->About Eclipse SDK.

It is possible that you have encountered bug 236437.

It turns out the cause is one or more artifact repositories being lost from the list of known repositories.The workaround is to remove the repository from the list and add it back again. This restores the missing artifact repository.
There’s a workaround for just follow these steps:

  1. Export the update site listing to bookmarks.xml file (Software Updates->Manage sites->Export)
  2. Stop eclipse.
  3. Remove the files /home/<USER>/.eclipse/configuration/.settings/org.eclipse.equinox.p2.*.prefs.
  4. Start eclipse again.
  5. Import the bookmarks.xml file (Software Updates->Manage sites->Import) that was exported in step 1

I couldn’t try it myself so it might not work!

Best of luck!:wink:

In the directory /home/<USER>/.eclipse/configuration/.settings/org.eclipse.equinox.p2.*.prefs is no folder named /.settings.?

Hello In_Control01,

O, sorry my fault.:shame:
It is in the directory /home/<USER>/.eclipse/org.eclipse.platform_3.4.0_1543616141/configuration/.settings/org.eclipse.equinox.p2.*.prefs.
I’m not sure if the folder has the same name as yours.
So look for a folder like this:

/home/<USER>/.eclipse/org.eclipse.platform_<VERSION>_<LOTS OF NUMBERS>/configuration/.settings/

Good luck!:wink: