Rush • A new and improved way of building extensions

if this is true then length of string i’m using is between 18k to 25k

wait i’m sending it

myString.txt (33.8 KB)

Here is the string

Code

Build in Version 1.0.1

I’ll send Build in 1.1.2 if it got installed properly again

Ironically, I was able to compile it with v1.1.2 without any errors…

even worked for me :me:
then the main problem is with old projects :expressionless:

Even i tried this

and it worked

But this not worked

#error

I’d suggest reading this answer on StackOverflow. It says,

Yes. There is a limit of 65535 on the length of a String literal1. It is not stated in the JLS, but it is implied by the structure of the class file; see JVM Spec 4.4.7 and note that the string length field is ‘u2’ … which means a 16 bit unsigned integer.

Note that a String object can have up to 2^31 - 1 characters. The 2^16 -1 limit is for String literals ; e.g. String constants that are embedded in the source code of a Java program.

1 - This limit is actually on the number of bytes in the (modified) UTF-8 representation of the String. If the string consists of characters in the range 0x01 to 0x7f, then each byte represents a single character. Otherwise, a character can require up to 6 bytes.



If you want to a String that represents the first million digits of Pi, then it would be better to read the characters from a file in the filesystem, or a resource on the classpath.

But why there was no error in old version??

TBH, I don’t know. :man_shrugging:

ok then how can i revert back to old version??
you can say i completely want to remove rush

I won’t suggest you do that. Stay with v1.1.2, and try to use some alternative solution, like, using the StringBuilder or storing the long string as a text file in the extension’s assets and read the text from it when needed.

Sharing you something in P.M. have a look

Hey, I get this error:

ERROR

and I see I can solve it by adding this in build.gradle:

SOLUTION

So, how can I modify build.gradle? Is there any other way to solve this error?:sweat_smile:

There is, but it’d be easier if @Shreyash modified the build.gradle.

You get that error when your extension (or one of it’s dependencies) use some Java 8 language feature. Currently, Rush doesn’t support use of Java 8 language features (like lambda expressions, method referencing, etc.).

Although, the upcoming release (v1.2.0) will bring support for Java 8 language features in Rush. I hope to release it by the end of next week.

build.gradle doesn’t exist in Rush as it doesn’t use Gradle. In fact, Rush in itself if a build tool just like Gradle, but designed specifically for building extensions.

4 Likes

Thanks for your explanation, don’t worry, I hope you will release Rush 1.2.0 soon:muscle:

1 Like

#off-topic what ide you use? it is very fancy

That’s not an IDE but just an image made using https://ray.so.

oh thanks for clearing up

The topic is itself a guide.
Isn’t that enough for you?. There is already all things are listed detailed in the topic. If you are stucked at anywhere then you can ask him.

2 Likes

I have Rush 1.1.1 Installed and I want to upgrade it, but seriously I don’t know how to turn off the Microsoft defender. Running (.exe) as Admin doesn’t work.


Anyway, is it okay to continue without upgrade…