-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Investigate Native-Compiling jdt.ls #13835
Comments
@rhopp of course it's not a Che 7 task. |
I don't know how jdt.ls is packaged but I don't think it will be possible to natively compile a OSGi app. |
@tsmaeder [1] https://github.com/redhat-developer/vscode-java |
@tolusha no, I just want to know if we can take the OSGI application that is jdt.ls and native-compile it with a fixed set of extension bundles. No containers involved. |
Well, we'll never know until we try :-) |
Few tips: https://quarkus.io/guides/writing-native-applications-tips |
For testing purpose I used osgi-mave-example [1] based on Apache Felix [2]. Despite the fact that dynamic class loading / unloading is not supposed [3] I tried to pack all classes in a single resulted file using Here is the script to prepare Reflection configuration file. It is supposed to be run in Cooking reflection configuration file
rm .classes
for f in *.jar
do
jar tvf $f | sed 's/ .* //g' | grep "class" | sed 's/\//./g' | sed 's/.class//g' > .classes
done
echo "[" > reflect.json
for c in $(cat .classes)
do
size=$(stat --printf="%s" reflect.json)
if (( $size > 10 )); then
echo "," >> reflect.json
fi
echo " {" >> reflect.json
echo "\"name\" : \"$c\"," >> reflect.json
echo "\"allDeclaredConstructors\" : true," >> reflect.json
echo "\"allPublicConstructors\" : true," >> reflect.json
echo "\"allDeclaredMethods\" : true," >> reflect.json
echo "\"allPublicMethods\" : true," >> reflect.json
echo "\"allDeclaredClasses\" : true," >> reflect.json
echo "\"allPublicClasses\" : true" >> reflect.json
echo " }" >> reflect.json
done
echo "]" >> reflect.json
rm .classes Command to compile the native-image -jar felix.jar \
-cp ../bundle/org.apache.felix.bundlerepository-2.0.6.jar:../bundle/org.apache.felix.gogo.command-0.16.0.jar:../bundle/org.apache.felix.gogo.runtime-0.16.2.jar:../bundle/org.apache.felix.gogo.shell-0.10.0.jar:../bundle/org.apache.felix.scr-2.0.2.jar \
-H:ReflectionConfigurationFiles=reflect.json \
-H:+ReportUnsupportedElementsAtRuntime \
--static --no-server I got the error:
It is weird, because the class above exists in [1] https://github.com/thomaseizinger/osgi-maven-example |
@tsmaeder suggested that I try getting it to work using atomos (https://github.com/tjwatson/atomos) and so here's what I found: For testing purposes I forked the atomos project [1] and added jdt.ls as a git submodule to the service.substract test folder and tried to use that to produce a native-image. After building the atomos project with Inside of the
One thing to notice from that output is that things like org.eclipse.jdt.ls.core are set to resolved and not active. If you try and start org.eclipse.jdt.ls.core manually for example, you'll receive I'm not sure if something is not getting loaded correctly or why this error is appearing but that's where my investigations ended. [1] - https://github.com/JPinkney/atomos/tree/jdt.ls-tests |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
I'd like to know how to native compile (using Graal VM) jdt.ls including the Microsoft debug extension. How does memory-consumption and performance change in the native-compiled version? How can we run it with those two VS Code extensions?
The text was updated successfully, but these errors were encountered: