Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run fails with new 'Go install' build system #248

Closed
dlsniper opened this issue Aug 30, 2013 · 13 comments
Closed

Run fails with new 'Go install' build system #248

dlsniper opened this issue Aug 30, 2013 · 13 comments

Comments

@dlsniper
Copy link
Member

I've built the master of this plug-in upon go 1.1.1 / amd64 and IntelliJ IDEA 129.1135 sources and tried to run a simple project.
Running the project will result in the following error:

Error running main.go: Cannot find target. Is main function defined in main package?

Compiling the project is working as expected. The other compile modes are unaffected by this issue.

Also, on IntelliJ IDEA v13 EAP 132.32, the new build system still gives out the deprecated message:

Deprecated make implementation
Old implementation of "Make" feature is enabled for this project.
It has been deprecated and will be removed soon.
Please enable newer 'external build' feature in Settings | Compiler.

Thanks.

cc @coocood

@coocood
Copy link

coocood commented Aug 30, 2013

Yes, I know this issue, but if you build the project for the first time before run it, it will work fine.
But I'm still not fully understand the project, it takes some time for me to resolve it, and I'm busy recently.

@dlsniper
Copy link
Member Author

I see, I'll leave this open for future reference. Thanks for the work on this ;)

@yaman
Copy link

yaman commented Dec 4, 2013

I am having this issue with IntelliJ 13, Mac 10.9. Building project before first run does not work either...

@dlsniper
Copy link
Member Author

dlsniper commented Dec 4, 2013

@abdulkadiryaman using the latest master, try switching to the default internal build system and then run the project. It should work. If not, paste here the error message

@yaman
Copy link

yaman commented Dec 4, 2013

@dlsniper it is already default to internal build system under GO settings from preferences. I can build the project, it compiles successfully. If I run it throws this error ;

12:02:30 AM Error running main.go: Cannot find target. Is main function defined in main package?

and the main.go is ;

package main

import "fmt"

func main() {
    fmt.Printf("Hello world!")
}

btw, @dlsniper thanks for the quick response...

@LarryBattle
Copy link
Contributor

I'm also having the exact same issue as abdulkadiryaman with Go 1.2 and IDEA 13

@sharvell
Copy link

sharvell commented Dec 5, 2013

Same here, osx 10.9, Go 1.2, Released IDEA 13, gopath is my $HOME/go.. GOROOT=/usr/local/go.. can compile fine but on run the default hello world returns: Error running main.go (5): Cannot find target. Is main function defined in main package.. If I hit the terminal "go run"... all is good

@sharvell
Copy link

sharvell commented Dec 5, 2013

also IDEA 12 works fine with released GO 1.2 and the go plugin...

@coocood
Copy link

coocood commented Dec 5, 2013

This bug has been fixed by 4df8926.

And Go Install or default build system doesn't matter any more.

@dlsniper
Copy link
Member Author

dlsniper commented Dec 5, 2013

Do you think it makes sense to hide the options for now? If so, I'll do a
PR for that.
On Dec 5, 2013 7:42 AM, "Ewan Chou" notifications@github.com wrote:

This bug has been fixed by 4df89264df8926
.

And Go Install or default build system doesn't matter any more.


Reply to this email directly or view it on GitHubhttps://github.com//issues/248#issuecomment-29875019
.

@coocood
Copy link

coocood commented Dec 5, 2013

Yes, I think the build system option should be hidden.

@LarryBattle
Copy link
Contributor

The plugin works now with IDEA 13 after being built with the latest code from this repository.
Here's the build process for Ubuntu 13 for those wondering.

# Make sure to install ant and java jdk
sudo apt-get install ant openjdk-6-jdk
git clone https://github.com/mtoader/google-go-lang-idea-plugin.git
cd google-go-lang-idea-plugin
gedit build-package.xml

Change the value of location to the installation directory of IDEA ide.
Example:

<property name="idea.community.build" location="${user.home}/Downloads/idea-IC-133.193/" />

Build the project with ant.

ant -f build-package.xml

After a successful build, dist/ro.redeul.google.go.jar should be created.
Lastly, import the jar as plugin (File > Settings > Plugins > "Install plugin from disk") and restart the IDEA ide.

@mtoader mtoader closed this as completed in 5b42e51 Dec 5, 2013
@sharvell
Copy link

sharvell commented Dec 6, 2013

LarryBattle, thanks! that worked for me as well, I had not seen the updates... ran the build on my ubuntu box snagged the jar and loaded on my osx box and all is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants