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

I cannot run the demos #459

Closed
Karakaz opened this issue Mar 21, 2017 · 13 comments
Closed

I cannot run the demos #459

Karakaz opened this issue Mar 21, 2017 · 13 comments

Comments

@Karakaz
Copy link

Karakaz commented Mar 21, 2017

Here's what I did:

  • Cloned the repository
  • Tried to build it with 'gradle build' it failed because of a failing test
(org.fxmisc.richtext.model.StyledTextAreaBehaviorTest > org.fxmisc.richtext.model.StyledTextAreaBehaviorTest$ContextMenuTests.requestingContextMenuViaKeyboardWorksOnWindows FAILED
    java.lang.AssertionError at StyledTextAreaBehaviorTest.java:86)
  • Opened the project in IntelliJ and built it with gradle
  • Build successful
  • Try to run a demo and this is what happened
"C:\Program Files\Java\jdk1.8.0_121\bin\java"

	-Didea.launcher.port=7536 "-Didea.launcher.bin.path=C:\Users\username\AppData\Roaming\JetBrains\IntelliJ IDEA Community Edition 2016.3.5\bin"

	-Dfile.encoding=UTF-8

	-classpath "C:\Program Files\Java\jdk1.8.0_121\jre\lib\charsets.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\deploy.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\access-bridge-64.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\cldrdata.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\dnsns.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jaccess.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jfxrt.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\localedata.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\nashorn.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunec.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunjce_provider.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunmscapi.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunpkcs11.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\zipfs.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\javaws.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\jce.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfr.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfxswt.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\jsse.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\management-agent.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\plugin.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\resources.jar
		C:\Program Files\Java\jdk1.8.0_121\jre\lib\rt.jar
		C:\Users\username\projects\TestingRandomThings\RichTextFX\richtextfx-demos\build\classes\main
		C:\Users\username\projects\TestingRandomThings\RichTextFX\richtextfx-demos\build\resources\main
		C:\Users\username\AppData\Roaming\JetBrains\IntelliJ IDEA Community Edition 2016.3.5\lib\idea_rt.jar"
		
	com.intellij.rt.execution.application.AppMain

	org.fxmisc.richtext.demo.CloneDemo

Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/fxmisc/richtext/InlineCssTextArea
	at org.fxmisc.richtext.demo.CloneDemo.start(CloneDemo.java:24)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	... 1 more
Caused by: java.lang.ClassNotFoundException: org.fxmisc.richtext.InlineCssTextArea
	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)
	... 10 more


Process finished with exit code 1

Appriciate any help

@JordanMartinez
Copy link
Contributor

Duplicate of #454

@JordanMartinez
Copy link
Contributor

@Karakaz Please use the new updated master branch.

@Karakaz
Copy link
Author

Karakaz commented Mar 21, 2017

All the tests are successful now but I am still getting java.lang.NoClassDefFoundError

@JordanMartinez
Copy link
Contributor

Strange.... Are you still building it via Gradle? Or through the IDE?

@Karakaz
Copy link
Author

Karakaz commented Mar 21, 2017

I tried both. Same result. Can you check if your runtime parameters are different from mine?

@JordanMartinez
Copy link
Contributor

Sorry, but I'm not sure what you're asking for.

@Karakaz
Copy link
Author

Karakaz commented Mar 22, 2017

My bad for being unclear. I meant if you could check what arguments your IDE is using when running a demo
java <args> org.fxmisc.richtext.demo.CloneDemo

@JordanMartinez
Copy link
Contributor

Ah ok. First I built the project:

cd RichTextFX/richtextfx-demos/
gradle clean
gradle build

Then I ran the code via the fat jar

java -cp build/libs/richtextfx-demos-fat-1.0.0-SNAPSHOT.jar org.fxmisc.richtext.demo.CloneDemo 

@Karakaz
Copy link
Author

Karakaz commented Mar 22, 2017

When I did this it worked flawlessly! I will investigate why it isn't working in IntelliJ further on stackoverflow. Cheers Jordan, keep up the good work.

Daniel

@JordanMartinez
Copy link
Contributor

Glad to hear it worked! Do you want to close this issue now? Or close it once you've figured out why the IDE version doesn't work?

@Karakaz
Copy link
Author

Karakaz commented Mar 22, 2017

The initial issue is solved but it might be a good idea to keep it open a little longer in case there is some gradle magic that could be added to make it run in intelliJ. If that is ok with you?

Made a stackoverflow issue on it here: http://stackoverflow.com/questions/42958182/error-when-trying-to-run-demos-in-a-gradle-project-in-idea

@JordanMartinez
Copy link
Contributor

If you're using the latest version, you can tell IntelliJ to delegate its builds to Gradle. Mr. Haki explains this further. Not sure if that's what you'd like to do, but it is one way around the issue.

@Karakaz
Copy link
Author

Karakaz commented Mar 22, 2017

That's genius! Amazing. Thank you for that. Sure, let's wrap this up.

@Karakaz Karakaz closed this as completed Mar 22, 2017
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

2 participants