GoClipse / goclipse

Eclipse IDE for the Go programming language:
http://goclipse.github.io/
Eclipse Public License 1.0
841 stars 290 forks source link

goclipse seems to be looking in /usr/local/go even If I set it to use another location in preferences #247

Closed roshanail closed 7 years ago

roshanail commented 7 years ago

I have setup go under /opt/go/v1.8.3

I wrote a simple program which prints out a message and tried to build it.

I get this error >> Running: /opt/go/v1.8.3/bin/go clean -i -x net.arc.test/test go: cannot find GOROOT directory: /usr/local/go ^^^ Terminated, exit code: 2 ^^^ I have attached a screenshot showing my preferences and the error.

image

image

This looks like a bug. Let me know if I made some mistake in the configuration.

bruno-medeiros commented 7 years ago

What happens if you run /opt/go/v1.8.3/bin/go clean -i -x net.arc.test/test on the command line?

ivandejanovic commented 7 years ago

I have the same issues as roshanail. Eclipse Mars with goclipse 0.14.1 works fine. Eclipse Neon with goclipse 0.16.1 reports the error. My go version is 1.8.3.

screenshot at 2017-06-22 14 51 15

screenshot at 2017-06-22 14 51 22

I created a new simple project. When i try to build from eclipse I get an error

screenshot at 2017-06-22 14 51 40

roshanail commented 7 years ago

Here is the command line output

roshan@ARC-T470p:~/go/src$ /opt/go/v1.8.3/bin/go clean -i -x net.arc.test/test
cd /home/roshan/go/src/net.arc.test/test
rm -f test test.exe test.test test.test.exe hello hello.exe
rm -f /home/roshan/go/bin/test

roshan@ARC-T470p:~/go/src$ /opt/go/v1.8.3/bin/go install  -x net.arc.test/test
WORK=/tmp/go-build189825138
mkdir -p $WORK/net.arc.test/test/_obj/
mkdir -p $WORK/net.arc.test/test/_obj/exe/
cd /home/roshan/go/src/net.arc.test/test
/opt/go/v1.8.3/pkg/tool/linux_amd64/compile -o $WORK/net.arc.test/test.a -trimpath $WORK -p main -complete -buildid 8bda8c8360f1df2f2f79549d9b68695070b4fc76 -D _/home/roshan/go/src/net.arc.test/test -I $WORK -pack ./hello.go
cd .
/opt/go/v1.8.3/pkg/tool/linux_amd64/link -o $WORK/net.arc.test/test/_obj/exe/a.out -L $WORK -extld=gcc -buildmode=exe -buildid=8bda8c8360f1df2f2f79549d9b68695070b4fc76 $WORK/net.arc.test/test.a
mkdir -p /home/roshan/go/bin/
mv $WORK/net.arc.test/test/_obj/exe/a.out /home/roshan/go/bin/test
bruno-medeiros commented 7 years ago

Okay, found it now, it has to do with a change introduced in 0.16.1 : https://github.com/GoClipse/goclipse/releases/tag/v0.16.1 , namely that the The GOROOT environment variable is no longer set. I thought the behavior introduced in 0.16.1 is the correct one, but now I'm not so sure. I think I will revert this change.

For now, as a workaround, you need to make GOROOT matches the Go installation you configured in Goclipse. (note you can either change GOROOT globally for your user, but you can also configure it per Build Target)

lucadistefano commented 6 years ago

How to change GOROOT globally for user? I tried to export GOROOT env variable when launching eclipse but seems is not seen by goclipse and I have not found in eclipse another place where set GOROOT . thanks

voinageo commented 6 years ago

Sadly GoClipse is dead the developers stopped maintaining the plugin in 2016. I still love Eclipse but lack of Go support makes it unusable. Very Sad.