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

can't build nor run #1

Open
maxandersen opened this issue Dec 10, 2024 · 3 comments
Open

can't build nor run #1

maxandersen opened this issue Dec 10, 2024 · 3 comments

Comments

@maxandersen
Copy link

when building I get this error:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running github.traffic.TileTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.030 s <<< FAILURE! -- in github.traffic.TileTest
[ERROR] github.traffic.TileTest.testManualLayout -- Time elapsed: 0.007 s <<< ERROR!
java.lang.Error: 
Unresolved compilation problems: 
	The method lines() is undefined for the type String
	The method lines() is undefined for the type String
	The method lines() is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method lines() is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method repeat(int) is undefined for the type String

	at manifold.github.traffic.Tile.<init>(Tile.java:43)
	at manifold.github.traffic.Tile.<init>(Tile.java:31)
	at github.traffic.TileTest.testManualLayout(TileTest.java:11)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   TileTest.testManualLayout:11 »  Unresolved compilation problems: 
	The method lines() is undefined for the type String
	The method lines() is undefined for the type String
	The method lines() is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method lines() is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method repeat(int) is undefined for the type String
	The method repeat(int) is undefined for the type String

if i skip tests I get a jar but then when running it you get:

java -jar target/github-traffic-0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
	Cannot invoke isNullOrEmpty() on the array type String[]

	at manifold.github.traffic.Main.main(Main.java:17)

whats the trick to get it to build?

@rsmckinney
Copy link
Member

It should build with mvn clean compile install

What version of JDK are you compiling with? Are you compiling with IntelliJ or command line?

@maxandersen
Copy link
Author

okey, so tried again with clean setup and I now can compile install and run...but it fails with wanting a starhistory.txt

Repo: jbangdev/jbang  2024-12-13 23:34:56

Exception in thread "main" java.io.FileNotFoundException: /Users/manderse/github-traffic/jbangdev/jbang/star_history.txt (No such file or directory)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
	at java.base/java.io.FileWriter.<init>(FileWriter.java:96)
	at manifold.github.traffic.Traffic.updateStarHistory(Traffic.java:159)
	at manifold.github.traffic.Traffic.showStats(Traffic.java:103)
	at manifold.github.traffic.Traffic.report(Traffic.java:59)
	at manifold.github.traffic.Main.main(Main.java:26)

@maxandersen
Copy link
Author

okey if I force create the folder at /Users/manderse/github-traffic/jbangdev/jbang then it works. something must be missing a create parent dir .

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