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

why use JDK17? #65

Closed
wangmiao-1981 opened this issue Aug 3, 2023 · 8 comments
Closed

why use JDK17? #65

wangmiao-1981 opened this issue Aug 3, 2023 · 8 comments

Comments

@wangmiao-1981
Copy link
Contributor

Many enterprises are currently using JDK 8 in their production scenarios.

Using a higher version of JDK may limit the usage scenarios.

I suggest downgrading to JDK 8.

@HamaWhiteGG
Copy link
Owner

JDK 17 provides many new syntax features, especially the text blocks functionality. I use it to write prompts; otherwise, Java 8 string concatenation would be a nightmare for me.

image

@wangmiao-1981
Copy link
Contributor Author

I think that in many enterprise scenarios, JDK8 still holds a significant share. As I work on banking systems, I consider that the main systems in this field are JDK8-based. If langchain-java can maintain compatibility with JDK8, it would be easier to gain practical application scenarios.

u can try this prompt, it works well for me.

    role: "system",
    content: `

You are a senior JAVA engineer who is very familiar with the syntax differences between JDK17 and JDK8,
and can proficiently convert code between the two.
Please convert the following JDK17 code into JDK8 code.
Do not provide suggestions, just convert the code.
Remember to enclose the converted code in a code block with the md format.
In handling multi-line strings, preserve the original formatting:
`

image

image

@HamaWhiteGG
Copy link
Owner

I appreciate your suggestion, but I have decided to stick with JDK 17 because I value the future more.

@scorego
Copy link

scorego commented Aug 11, 2023

You can integrate Scala with Java 8.

val speech = """Four score and
               |seven years ago""".stripMargin

https://www.oreilly.com/library/view/scala-cookbook/9781449340292/ch01s03.html

@HamaWhiteGG HamaWhiteGG mentioned this issue Sep 6, 2023
@leonaemsears
Copy link

Many enterprises are currently using JDK 8 in their production scenarios.

Using a higher version of JDK may limit the usage scenarios.

I suggest downgrading to JDK 8.

Hi, Did you manage to get the code working with JDK8 ? if so what changes did you make to have it build.

@wangmiao-1981
Copy link
Contributor Author

wangmiao-1981 commented Oct 12, 2023 via email

@HamaWhiteGG
Copy link
Owner

Yes, I am using this project under JDK8, with the main modifications focusing on JDK17's strings and a few features. My approach is to directly compile this project with JDK8, and use GPT to resolve any errors that arise. my prompt is : You are a senior JAVA engineer who is very familiar with the syntax differences between JDK17 and JDK8, and can proficiently convert code between the two. Please convert the following JDK17 code into JDK8 code. Do not provide suggestions, just convert the code. Remember to enclose the converted code in a code block with the md format. In handling multi-line strings, preserve the original formatting: It works well for me. For more details, you can refer to my previous email.

2023年10月2日 21:37,leonaemsears @.***> 写道: Many enterprises are currently using JDK 8 in their production scenarios. Using a higher version of JDK may limit the usage scenarios. I suggest downgrading to JDK 8. Hi, Did you manage to get the code working with JDK8 ? if so what changes did you make to have it build. — Reply to this email directly, view it on GitHub <#65 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWRVRPCVYIBLZXVTBRLPWFTX5K7TLAVCNFSM6AAAAAA3CZCKMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBTGAZTIMBVGY. You are receiving this because you authored the thread.

Good prompt,Great Job!

@HamaWhiteGG
Copy link
Owner

HamaWhiteGG commented Oct 12, 2023

@wangmiao-1981 I've created a JDK8 branch to support Java 8. Would you be willing to contribute your code? Let's learn and work together.

Currently, @Jashinck is contributing to the JDK8 branch, but it's still in progress. We can maintain Java 8 together.

https://github.com/HamaWhiteGG/langchain-java/tree/jdk8

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

4 participants