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

IntelliJ Class not found bug #357

Closed
ghost opened this issue Apr 6, 2016 · 14 comments
Closed

IntelliJ Class not found bug #357

ghost opened this issue Apr 6, 2016 · 14 comments

Comments

@ghost
Copy link

ghost commented Apr 6, 2016

Whenever I try to run Sponge through IntellijIDEA (Latest version) I get this error

Exception in thread "main" java.lang.ClassNotFoundException: GradleStartServer
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)

@AbrarSyed
Copy link
Member

you probably have the run configurations set for the wrong module.
see #351

@ghost
Copy link
Author

ghost commented Apr 6, 2016

I still don;t understand what I'm supposed to do to resolve this.

@liach
Copy link
Contributor

liach commented Apr 6, 2016

Run gradlew runClient for now.

@liach
Copy link
Contributor

liach commented Apr 6, 2016

@AbrarSyed I meet this problem too, it says something like GradleStart is not in classpath.

@AbrarSyed
Copy link
Member

Yal need to learn to use your chosen IDE. Inyelloj 2016 made it so that a standard gradle project has 3 modules. Project, project-main, and project-test.
The run configurations are targetting the 'project' module instead of 'project-main'.

@liach
Copy link
Contributor

liach commented Apr 6, 2016

Oh thanks.

@ghost
Copy link
Author

ghost commented Apr 6, 2016

I wasn't aware of that addition to IntellijJ thank you Abrar :)

@liach
Copy link
Contributor

liach commented Apr 8, 2016

By the way @AbrarSyed how to launch dev inv with test mods for forge? I could only launch without test mods.

@shaneknysh
Copy link

For those using IntelliJ to correct this error:

After you have setup your project and run the 'genIntellijRuns' task from Gradle panel

  1. Select the 'Run' menu
  2. Select 'Edit Configurations...'
  3. In the navigation tree select 'Minecraft Client'
  4. for the value of 'Use classpath of module' change the value from '[YourModName]' to '[YourModName]_main'.
  5. Click 'Apply'
  6. In the navigation tree select 'Minecraft Server'
  7. for the value of 'Use classpath of module' change the value from '[YourModName]' to '[YourModName]_main'.
  8. Click 'Apply'

Tested using Intellij 2016.1.3 and the 10.2 experimental mdk

@RexTheCapt
Copy link

@shaneknysh when i click on "Use classpath of module" i do not get [modname]_main in the dropdown menu at all. The only two choises i get is "" and "[modname]"

@liach
Copy link
Contributor

liach commented Jul 17, 2018

@RexTheCapt Because you need to separate each source set into a module when you import

@RexTheCapt
Copy link

@liach how do i do that?

@liach
Copy link
Contributor

liach commented Jul 17, 2018

@RexTheCapt https://youtu.be/G2aPT36kf60
I am too lazy to explain.

@DaemonUmbra
Copy link
Member

Closing this issue as it does not appear to be applicable to the currently supported ForgeGradle branch (FG_3.0).

If I am incorrect in this regard, please create a new issue prefixed with [FG_3.0] and containing:

  • A summary of the issue (in case the issue has mutated slightly or the original report was poorly described)
  • Steps to recreate the issue
  • Console output or logs (if possible)

Note that an ongoing effort to update legacy MinecraftForge branches to utilize FG_3.0 is ongoing and accepting informed contributions. (For more information join the Discord and read through the #mcpconfig channel)

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