Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Installing cdtdebug.sh script
Installing cdtdebug.sh script [message #1737283] Wed, 06 July 2016 21:49 Go to next message
Bob Jenkins is currently offline Bob JenkinsFriend
Messages: 3
Registered: July 2016
Junior Member
Hi all,

I'm getting a "java.lang.ClassNotFoundException" error when attempting to run cdtdebug.sh, has anyone seen this before?

Here's what I've tried:
1) Install Eclipse Neon (version 4.6.0 / Build id 20160613-1800) and select "Eclipse IDE for C/C++ Developers"
2) I found cdtdebug.sh in the ~/.p2 directory and attempted to run the installer script ~/.p2/pool/plugins/org.eclipse.cdt.debug.application_1.1.0.201606062011/scripts/install.sh) but installation failed:
./install.sh: error: eclipse executable not found in expected location

3) After debugging cdtdebug.sh it looks like this needs to be run from my Eclipse installation directory so I copied the "org.eclipse.cdt.debug.application_1.1.0.201606062011" directory to Eclipse configuration directory (/eclipse/cpp-neon/eclipse/configuration/)
4) Run install.sh from Eclipse configuration directory...success!
5) Run newly created ~/cdtdebugger/cdtdebug.sh file...got an error
./cdtdebug.sh: 86: ./cdtdebug.sh: [[: not found

6) Re-run install.sh from "~/eclipse/cpp-neon/eclipse/configuration/org.eclipse.cdt.debug.application_1.1.0.201606062011" to ensure that the ECLIPSE_HOME variable gets set correctly
7) Run cdtdebug.sh again, new error:
!SESSION Wed Jul 06 14:29:59 PDT 2016 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2016-07-06 14:29:59.547
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:670)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1492)


Also, I am running Ubuntu 16.04 (64-bit).

Any idea what I'm doing wrong?

Thanks
Re: Installing cdtdebug.sh script [message #1737305 is a reply to message #1737283] Thu, 07 July 2016 07:59 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
My guess, but I have not had a chance to try it out, is that you have installed CDT using the Eclipse Installer and it used a shared p2 directory. Looking at the install script, I don't think it supports that option yet.

Can I recommend installing the CDT download (the tar file) instead and trying again.

Instructions are here: https://wiki.eclipse.org/CDT/StandaloneDebugger
Assuming you are on Linux64, the Full CDT package tar file is: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/neon/R/eclipse-cpp-neon-R-linux-gtk-x86_64.tar.gz
The link for the standalone debugger for Neon is: http://download.eclipse.org/tools/cdt/releases/9.0/r/rcp/ that provides the minimum install.

If you could enter a bug about standalone install script not working for p2 based install, that would be very helpful!
Re: Installing cdtdebug.sh script [message #1737378 is a reply to message #1737305] Thu, 07 July 2016 16:27 Go to previous messageGo to next message
Bob Jenkins is currently offline Bob JenkinsFriend
Messages: 3
Registered: July 2016
Junior Member
Quote:

Can I recommend installing the CDT download (the tar file) instead and trying again.


I can confirm this worked, thanks! Steps below in case anyone else is interested:
1) downloaded eclipse-cpp-neon-R-linux-gtk-x86_64.tar.gz and extracted into ~/eclipse2
2) Run install.sh while you are in the ~/eclipse2/eclipse/plugins/org.eclipse.cdt.debug.application_1.1.0.201606062011 directory, this is a rather odd requirement but being in this specific directory is needed. I may have also had to make install.sh executable, can't remember.
3) Debug application, e.g.
~/cdtdebugger/cdtdebug.sh -e ./a.out

Quote:

The link for the standalone debugger for Neon is: http://download.eclipse.org/tools/cdt/releases/9.0/r/rcp/ that provides the minimum install.

Thanks, this approach also worked...and it's so so simple I just downloaded and extracted the tarball and was able to run cdtdebug.sh without any installation.

Quote:
If you could enter a bug about standalone install script not working for p2 based install, that would be very helpful!


Thanks, bug has been created -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=497506

[Updated on: Thu, 07 July 2016 16:27]

Report message to a moderator

Re: Installing cdtdebug.sh script [message #1737380 is a reply to message #1737378] Thu, 07 July 2016 16:35 Go to previous messageGo to next message
Bob Jenkins is currently offline Bob JenkinsFriend
Messages: 3
Registered: July 2016
Junior Member
Also, I am not sure if this counts as a bug but every time I run cdtdebug.sh I get the error below:
/home/bob/cdtdebugger/cdtdebug.sh: 86: /home/bob/cdtdebugger/cdtdebug.sh: [[: not found


The issue is that cdtdebug.sh is using a non portable way of pattern matching here:
if [[ $ECLIPSE_HOME == *MacOS ]]; then
  ECLIPSE_HOME="$ECLIPSE_HOME/../Eclipse"
fi


The issue can be fixed by replacing the code above with this:
case $ECLIPSE_HOME in
        *MacOS) ECLIPSE_HOME="$ECLIPSE_HOME/../Eclipse" ;;
esac


This bug would affect anyone using Ubuntu with the default shell (dash) which does not support "[["...more info here - http://mywiki.wooledge.org/Bashism#Conditionals. I would think many users would also be seeing this issue although it can be safely ignored.
Re: Installing cdtdebug.sh script [message #1737389 is a reply to message #1737380] Thu, 07 July 2016 17:14 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Yes, I think that is a bug, I have raised it: https://bugs.eclipse.org/bugs/show_bug.cgi?id=497512
Re: Installing cdtdebug.sh script [message #1737390 is a reply to message #1737389] Thu, 07 July 2016 17:19 Go to previous message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Hi Bob,

On a final note, thank you for taking time to identify a problem and try a workaround. It is with community feedback like this that the quality can improve.

Jonah
Previous Topic:Problem with Template class and Code generation
Next Topic:Importing cmake projet
Goto Forum:
  


Current Time: Tue Apr 23 10:07:49 GMT 2024

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

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

Back to the top