#The File or extention is too long

1 messages · Page 1 of 1 (latest)

ionic egret
#

Hey Everyone,

I'm facing this issue which says the file or extention is too long while I'm trying to run my project, I'm working on windows and try everything regarding long path but not working

turbid vortexBOT
#

<@&1004656351647117403> please have a look, thanks.

undone rose
#

it seems you're using springboot maven plugin to run a java program

ionic egret
#

Yes

undone rose
#

./mvnw clean install

ionic egret
#

It's not working

undone rose
ionic egret
#

but wile I'm trying to run

mvn spring-boot:run -Pdev

on my macbook, it's working and running

ionic egret
undone rose
#

maybe you have wrong JDK

junior drum
foggy chasm
foggy chasm
#

@ionic egret you're running into windows path length issues, can you share your pom file?

undone rose
#

the guy says that on apple same code works

foggy chasm
#

There have been very few OS specific bugs.

undone rose
#

What

#

Spring Boot 3.0 requires Java 17 as a minimum version

#

if they use lower version, they may have issues

#

i agree to share the pom file content so we know the setup

foggy chasm
undone rose
#

but also, let us know about your installed JDK @ionic egret

undone rose
#

as long as jdk install is in os

foggy chasm
#

Sigh.

#

This is an OS related issue, not a JDK one.

ionic egret
#

I'm using JDK17

foggy chasm
#

Where is your .m2 folder located?

ionic egret
#

C:\Users\Arundhati Hazra\ .m2

foggy chasm
#

can you do mvn -X spring-boot:run and check for forked process?

#

There are a couple of options, likely the easiest is moving your .m2 folder to the root if that pops something up. Given those dependenies you might be dragging something quite long in.

undone rose
#

Try to do

#

./mvnw clean install -U

#

It seems u have some corrupted dependencies

#

If that doesn't solve it, then try to delete all dependencies in m2

#

Then retry

#

Also, is there a settings.xml file inside m2?

ionic egret
undone rose
#

The error says spring context failed to load for testclass

#

I think that's the problem

ionic egret
foggy chasm
#

The reason that test fails is the same as why they can't run it.

ionic egret
#

Okay, what would be the solution

foggy chasm
#

Still at work, I just had a short coffee break but just check what I asked earlier in regards to the classpath length.

ionic egret
#

You didn't mentioned

foggy chasm
#

#1275369200596291625 message

#

And below.

#

The .m2 recommendation is more likely to help.
But I have to return to work.

ionic egret
#

Okay let me try with -X

undone rose
#

If the works with this command

#

That means the problem is only in tests

lean merlin
#

the issue is not a malformed test firas

#

it is bc the paths are too long

#

windows has a path limit of 255 characters

#

unless wide-paths are enabled

#

so if u happen to construct a file-path that is longer than that, windows says nope

undone rose
#

Never saw this

ionic egret
lean merlin
#

🙂

ionic egret
lean merlin
#

so maven failed to launch the entire setup as something in the chain of actions is too long for windows

#

so we have to find the something

ionic egret
#

So there must be solution for that

lean merlin
#

helpers suspected something in the pom and especially the .m2 where it would load external deps from

#

especially .m2 can easily create very long paths with deeply nested dependencies

#

for example, if ur .m2 is installed in a path that is already a bit longer, lets say C:/Users/John/Foo/Bar/Baz/Bblabla/.m2 and then u have a dependency in there with a long name, lets say

ionic egret
undone rose
#

Hmm it's possible that a directory name with space between like "my directory" may behind this?

lean merlin
#

com/spring/boot/foo/bar/baz/

#

then the entire path to down there is very long:

#

C:/Users/John/Foo/Bar/Baz/Bblabla/.m2/com/spring/boot/foo/bar/baz/

#

and can easily outrun windows limit of 255 characters

#

in which case it all breaks

ionic egret
lean merlin
#

well, ur name isnt that short to be fair

ionic egret
#

This is the play where m2 file located

lean merlin
#

there could be other offenders than just m2 though

#

it was just one (common) source for this

ionic egret
#

So what should I do

lean merlin
#

to make sure its not the m2, u could move it to a top level directory instead

#

such as C:/.m2

#

that would give u like 30 more characters room

#

otherwise u can also try to enable windows wide-path mode

#

or continue searching for other offenders in ur maven setup

#

also, are u sure the actual path is short?

#

it seems like ur launching from mingw

ionic egret
lean merlin
#

so if its virtual filesystem is somewhere deeper down the file paths, the actual file path on ur windows system would be very long

#

like, mingws /d/surely-insurance-core/partner might actually be C:/Users/John/Foo/bar/Baz/Boo/baba/blabla/blabla/mingw/deepdown/filesystem/d/surely-insurance-core/partner

#

if u get what i mean

lean merlin
#

u cant just move the folder around and expect it to find it still

foggy chasm
foggy chasm
# ionic egret Just moved that folder to c:/ ?
* Move .m2 repository to c:\
* Open settings.xml from %MAVEN_HOME%/conf and look for \<settings>.\<localRepository>(uncomment it if its commented out already) and change its value to c:/.m2/repository
* Save the file and run the build again
ionic egret
south plank
lean merlin
#

ur looking in the wrong folder

foggy chasm
ionic egret
#

It's not working

lean merlin
#

okay. then try the m2 thing instead

lean merlin
#

👍

ionic egret
#

What path should I change

#

I have to command out these lines, right?

foggy chasm
#

Uncomment it, and change the path value (the one currently saying path to local).

foggy chasm
#

Yes.

ionic egret
#

Now it's downloading plugins again

#

Let's hope for the best

ionic egret
#

Guys it's still not working

#

😕😕

south plank
#

still same error?

foggy chasm
#

And you restarted your computer right?

undone rose
undone rose
south plank
#

its known though

#

and he told about it

#

and it just got ignored

ionic egret
ionic egret
#

Just facing these

undone rose
#

tht's why i doubt it's cuz of os

undone rose
#

i mean copy/paste not all of it

#

just the last 10 lines

#

without any dependency

#

and try to install and run it locally

#

in order to be certain that it's general issue on ur machine

ionic egret
ionic egret
#

Any more suggestions

undone rose
#

in this "Program Files"

#

that space causes the issue

#

do u use a maven wrapper? ?

ionic egret
undone rose
south plank
foggy chasm
#

The wrapper works just fine with spaces...

crisp ivy
#

have you tried running with the longClasspath flag set to true?

#

seems like you can edit it within GP

#

@ionic egret

sweet eagle
#

I've noticed bad things happen when you have a space in your user name on windows. Arguments get split on that space character and shift the argument list. You have to turn on the most explicit logging.

#

Or try wsl

foggy chasm
#

I see you're running it from intellij, what you can also try is within your run configuration check shorten command line and then select the apt value in your configuration.

crisp ivy
ionic egret
ionic egret
#

Thank you guys