Comments (13)
I think , you can fixe it like this:
copy all files in java-1.8.0-openjdk-amd64/lib
to java-1.8.0-openjdk-amd64/jre/lib
from sts4.
Hey @khe817, I thought we put something in place to make things work with JDK9 (should work out of the box), but looks like there is something going wrong here. What OS are you running on?
from sts4.
As far as I can tell an empty tools.jar works just as well
from sts4.
@khe817 are you trying the latest 0.1.2
version? Is JDK 9.0.0 working?
from sts4.
Ok, I have just tried 0.1.2. Boot hints should work with Java 9.0.1 regardless of the message:
JAVA_HOME environment variable points either to JRE or JDK missing "lib/tools.jar" hence Boot Hints are unavailable
No need to copy tools.jar
. It doesn't look properly for tools.jar
in Java 9 and hence shows the message but it still uses tools.jar
. We should just correct the lookup for tools.jar
for java 9 not to show the message that's all. It works regardless of the message.
from sts4.
The message comes from a test in vscode-extensions/vscode-boot-java/lib/Main.ts
classpath: (context: VSCode.ExtensionContext) => {
const classpath = [
Path.resolve(context.extensionPath, 'jars/language-server.jar')
];
const toolsJar = commons.findJvmFile('lib', 'tools.jar');
if (toolsJar) {
classpath.push(toolsJar);
} else {
VSCode.window.showWarningMessage('JAVA_HOME environment variable points either to JRE or JDK missing "lib/tools.jar" hence Boot Hints are unavailable');
}
return classpath;
},
There is however no comment explaining the need for tools.jar.
from sts4.
@martinborgman we use the JMX remote management implementation of the JDK to connect to the running boot app and to get data from the actuators on those projects, therefore the need for us to use the tools.jar library of the JDK (which contains the code for the remote management agent stuff). JDK9 is different (due to the module system), so the message for the user is definitely misleading and we should fix that.
In case you don't see any live hovers, you should make sure that you have the Spring Boot actuators included in your project. If that is the case, but live hovers still aren't showing up, we need to investigate this further.
Next step would be to check if you could connect to the running Spring Boot application using "jconsole". Does that work for you?
If that doesn't work, you might hit a network config case that makes it hard for the language server to connect to the app via JMX. You could try to add -Djava.rmi.server.hostname=localhost
as a VM param to the launch config of your Spring Boot app and start it again. Does that make a difference?
from sts4.
Confirmed working without having to copy lib/tools.jar over despite error message showing up on start up.
Boot Hint however interferes with redhat.java plugin (Language support for Java by Red Hat) somehow. It makes redhat.java run slow, and code complete no long work.
Boot Hint works fine along side with redhat.java plugin with java JDK 1.8.x.
from sts4.
@martinlippert I was only commenting on where the error came from.
That said, I played some more with both Java 8 as Java 9 and at first neither worked because the test project I was using did not contain Spring Boot actuators. It now works fine with Java 8.
With Java 9 not all things work, for example I was unable to lookup the runtime endpoints. And as @khe817 mentions, many things are slower when using Java 8.
As for the connecting to a running application, it works the same as running the application inside vscode.
I currently don't have a tools.jar file in Java 9 lib directory.
from sts4.
I probably should make a new issue regarding Spring Boot 2.0 and actuator, because that is what is causing my Java 9 endpoints not showing issue.
from sts4.
(comment in Pivotal Tracker added by Martin Lippert:)
there is a separate story about improving the warning about the missing tools.jar (to not show that one up when running on JDK9): #153612030.
This ticket should be used to investigate the described slowdown when running on JDK9 (in combination with the RedHat Java Language extension).
from sts4.
on OSX my JAVA_HOME was pointing to an old version when i got the same error. I get that this issue is actually different, but google did bring me here, so just sharing what worked for me (JDK version 8):
# input jdk dir
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/
launchctl setenv JAVA_HOME $JAVA_HOME
# need to restart vscode for this to work
from sts4.
we improved the way the tools.jar is being found in the next milestone update release (M8), therefore I am going to close this issue here.
The slowness when running on JDK9 that got mentioned in a few comments got moved to its own issue here: #36
from sts4.
Related Issues (20)
- Build sts4 for LoongArch HOT 7
- SpringToolSuite (x_86_64 option) IDE keeps crashing frequently. HOT 5
- java.lang.ClassNotFoundException: org.eclipse.jdt.ls.core.internal.javadoc.JavaElementLinks cannot be found by ... HOT 1
- Eclipse crashes after upgrade of libwebkit2gtk to 2.44.x HOT 21
- renaming of files and packages causes symbols to get out of sync HOT 6
- show a nice message when trying to change log levels without a connected running app HOT 4
- CompilationUnitCache: gracefully cleanup the name environment HOT 1
- SpEL Syntax Highlighting
- syntax highlighting for embedded languages (SpEL, JPQL, SQL, HQL, etc.) inside of Java editor (in Eclipse)
- add parser-based validation for JPQL, SQL, HQL snippets HOT 3
- improve parser-based validation for SpEL snippets
- Activating 'vscode-spring-boot' extension HOT 2
- NPE exception while scanning for symbols HOT 1
- upgrade of Eclipse based installs broken HOT 2
- NPE while updating Spring Boot version HOT 5
- "Code Completion" works fine in `application.properties` file, but does not work for `application.yml` file. HOT 7
- `Map<K,V>` with escaped key not works properly in `application.yml` HOT 1
- Gradle option when importing guides or creating new initializr projects is missing HOT 2
- upgrade dialog to select recipe appears twice HOT 2
- Dialog for open-rewrite recipes shows "Loading..." and nothing happens HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sts4.