Ubuntu/GraalVM: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 3: Line 3:
|valign="top" colspan="2"|
|valign="top" colspan="2"|
<source lang="bash">
<source lang="bash">
sudo mkdir -p /opt/cli
sudo wget -c https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/\
sudo wget -c https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/\
graalvm-ce-java17-linux-amd64-22.0.0.2.tar.gz -P /opt/cli/
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz -P /opt/cli/


sudo tar -xvzf /opt/cli/\
sudo tar -xvzf /opt/cli/graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz -C /opt/cli/
graalvm-ce-java17-linux-amd64-22.0.0.2.tar.gz -C /opt/cli/
sudo rm  -rf  /opt/cli/graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz


export GRAALVM_HOME=/opt/cli/graalvm-ce-java17-22.0.0.2
cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh
sudo rm -rf /opt/cli/graalvm-ce-java17-linux-amd64-22.0.0.2.tar.gz
# chorke academia sys
export GRAALVM_HOME='/opt/cli/graalvm-ce-java17-22.0.0.2'
 
EOF
</source>
</source>


Line 29: Line 31:
update-alternatives --query gu
update-alternatives --query gu
update-alternatives --query js
update-alternatives --query js
sudo update-alternatives --install /usr/bin/jconsole jconsole\
$GRAALVM_HOME/bin/jconsole 1983
sudo update-alternatives --install /usr/bin/jshell jshell\
$GRAALVM_HOME/bin/jshell 1983


sudo update-alternatives --install /usr/bin/javac javac\
sudo update-alternatives --install /usr/bin/javac javac\
  $GRAALVM_HOME/bin/javac 3
  $GRAALVM_HOME/bin/javac 1983


sudo update-alternatives --install /usr/bin/java java\
sudo update-alternatives --install /usr/bin/java java\
  $GRAALVM_HOME/bin/java 3
  $GRAALVM_HOME/bin/java 1983
</source>
</source>


|valign="top"|
|valign="top"|
<source lang="bash">
<source lang="bash">
sudo update-alternatives --install /usr/bin/jdb jdb\
$GRAALVM_HOME/bin/jdb 1983
sudo update-alternatives --install /usr/bin/jps jps\
$GRAALVM_HOME/bin/jps 1983
sudo update-alternatives --install /usr/bin/js js\
sudo update-alternatives --install /usr/bin/js js\
  $GRAALVM_HOME/bin/js 1
  $GRAALVM_HOME/bin/js 1983


sudo update-alternatives --install /usr/local/bin/gu gu\
sudo update-alternatives --install /usr/local/bin/gu gu\
  $GRAALVM_HOME/bin/gu 1
  $GRAALVM_HOME/bin/gu 1983


sudo gu install native-image
sudo gu install native-image
sudo update-alternatives --install /usr/bin/native-image native-image\
sudo update-alternatives --install /usr/bin/native-image native-image\
  $GRAALVM_HOME/bin/native-image 1
  $GRAALVM_HOME/bin/native-image 1983


native-image --version
native-image --version
Line 100: Line 114:
|-
|-
|valign='top'|
|valign='top'|
  ls -lah /opt/graalvm*/bin/|grep java
  '''ls -lah /opt/graalvm*/bin/|grep java'''
  alternatives --config native-image
  alternatives --config native-image
alternatives --config jconsole
alternatives --config jshell
  alternatives --config javac
  alternatives --config javac
  alternatives --config java
  alternatives --config java
Line 108: Line 124:


|valign='top'|
|valign='top'|
  microdnf install wget
  '''microdnf install httpd-tools'''
  microdnf install curl
'''microdnf install nginx'''
'''microdnf install wget'''
  '''microdnf install curl'''
  javac -version
  javac -version
  java -version
  java -version
Line 150: Line 168:


|}
|}
==Graal JS==
<source lang="java">
new ScriptEngineManager().getEngineByName("graal.js");
/*
List<ScriptEngineFactory> engines = (new ScriptEngineManager()).getEngineFactories();
for (ScriptEngineFactory f: engines) {
    System.out.println(f.getLanguageName()+" "+f.getEngineName()+" "+f.getNames().toString());
}*/
</source>


==Knowledge==
==Knowledge==
Line 240: Line 269:


| valign="top" |
| valign="top" |
* [https://www.graalvm.org/22.0/reference-manual/js/RunOnJDK/ Run GraalVM JavaScript on a Stock JDK]
* [https://developers.redhat.com/articles/2021/12/14/explore-java-17-language-features-quarkus Java 17 language features with Quarkus]
* [https://stackoverflow.com/questions/69272445/ Java 8 »17 Migration Issue for Lombok]
* [https://stackoverflow.com/questions/69272445/ Java 8 »17 Migration Issue for Lombok]
* [https://unix.stackexchange.com/questions/47434/ Difference between curl vs. wget]
* [https://rollbar.com/blog/quarkus-vs-spring-boot/ Quarkus vs Spring Boot]
* [https://stackoverflow.com/questions/31851611/ ARM64 vs. AArch64]
* [https://stackoverflow.com/questions/31851611/ ARM64 vs. AArch64]
* [https://github.com/graalvm/mandrel/releases Mandrel: Download]
* [[Docker Compose]]
* [[Docker Compose]]
* [[MacOS/GraalVM]]
* [[HAProxy]]




| valign="top" |
| valign="top" |
* [https://www.graalvm.org/22.0/reference-manual/js/Options/ GraalVM JavaScript Launcher Options]
* [https://infolinux.com/2019/02/19/install-unijoy-in-linux/ Install Unijoy on Linux]
* [[JShell]]


|-
|-

Latest revision as of 08:30, 9 May 2022

Install

sudo wget -c https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/\
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz -P /opt/cli/

sudo tar -xvzf /opt/cli/graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz -C /opt/cli/
sudo rm  -rf   /opt/cli/graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz

cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh
# chorke academia sys
export GRAALVM_HOME='/opt/cli/graalvm-ce-java17-22.0.0.2'

EOF

update-alternatives --query native-image
update-alternatives --query jconsole
update-alternatives --query jshell
update-alternatives --query javac
update-alternatives --query java
update-alternatives --query jdb
update-alternatives --query jps
update-alternatives --query gu
update-alternatives --query js

sudo update-alternatives --install /usr/bin/jconsole jconsole\
 $GRAALVM_HOME/bin/jconsole 1983

sudo update-alternatives --install /usr/bin/jshell jshell\
 $GRAALVM_HOME/bin/jshell 1983

sudo update-alternatives --install /usr/bin/javac javac\
 $GRAALVM_HOME/bin/javac 1983

sudo update-alternatives --install /usr/bin/java java\
 $GRAALVM_HOME/bin/java 1983
sudo update-alternatives --install /usr/bin/jdb jdb\
 $GRAALVM_HOME/bin/jdb 1983

sudo update-alternatives --install /usr/bin/jps jps\
 $GRAALVM_HOME/bin/jps 1983

sudo update-alternatives --install /usr/bin/js js\
 $GRAALVM_HOME/bin/js 1983

sudo update-alternatives --install /usr/local/bin/gu gu\
 $GRAALVM_HOME/bin/gu 1983

sudo gu install native-image
sudo update-alternatives --install /usr/bin/native-image native-image\
 $GRAALVM_HOME/bin/native-image 1983

native-image --version
sudo gu --version
javac -version
java -version
js -version

Docker

Java 17 » GraalVM ??:


docker pull ghcr.io/graalvm/jdk:ol8-java17
docker pull ghcr.io/graalvm/nodejs:ol8-java17
docker pull ghcr.io/graalvm/graalvm-ce:ol8-java17
docker pull ghcr.io/graalvm/native-image:ol8-java17
docker run -it --rm ghcr.io/graalvm/jdk:ol8-java17 bash
docker run -it --rm ghcr.io/graalvm/nodejs:ol8-java17 bash
docker run -it --rm ghcr.io/graalvm/graalvm-ce:ol8-java17 bash
docker run -it --rm ghcr.io/graalvm/native-image:ol8-java17 --help

Java 17 » GraalVM 22:


docker pull ghcr.io/graalvm/jdk:ol8-java17-22
docker pull ghcr.io/graalvm/nodejs:ol8-java17-22
docker pull ghcr.io/graalvm/graalvm-ce:ol8-java17-22
docker pull ghcr.io/graalvm/native-image:ol8-java17-22
docker run -it --rm ghcr.io/graalvm/jdk:ol8-java17-22 bash
docker run -it --rm ghcr.io/graalvm/nodejs:ol8-java17-22 bash
docker run -it --rm ghcr.io/graalvm/graalvm-ce:ol8-java17-22 bash
docker run -it --rm ghcr.io/graalvm/native-image:ol8-java17-22 --help

Java 17 » GraalVM ?? » Oracle Linux 8:


ls -lah /opt/graalvm*/bin/|grep java
alternatives --config native-image
alternatives --config jconsole
alternatives --config jshell
alternatives --config javac
alternatives --config java
alternatives --config gu
alternatives --config js
microdnf install httpd-tools
microdnf install nginx
microdnf install wget
microdnf install curl
javac -version
java -version
gu --version
js -version

Maven

sudo wget -c https://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/\
apache-maven-3.8.4-bin.tar.gz -P /opt/cli/

sudo tar -xvzf /opt/cli/apache-maven-3.8.4-bin.tar.gz\
 -C /opt/cli/

export MAVEN_HOME=/opt/cli/apache-maven-3.8.4
sudo rm -rf /opt/cli/apache-maven-3.8.4-bin.tar.gz

update-alternatives --query mvn
sudo update-alternatives --install /usr/bin/mvn mvn\
 $MAVEN_HOME/bin/mvn 1
update-alternatives --config mvn
update-alternatives --query mvn
mvn -v

Graal JS

new ScriptEngineManager().getEngineByName("graal.js");

/*
List<ScriptEngineFactory> engines = (new ScriptEngineManager()).getEngineFactories();
for (ScriptEngineFactory f: engines) {
    System.out.println(f.getLanguageName()+" "+f.getEngineName()+" "+f.getNames().toString());
}*/

Knowledge

sudo update-alternatives --remove-all javac
sudo update-alternatives --remove-all java
sudo update-alternatives --remove-all gu

ssh-keygen -f "/home/chorke/.ssh/known_hosts" -R "10.19.83.111"
ssh-keygen -f ~/.ssh/known_hosts -R 10.19.83.111
apt search upx
sudo apt install upx-ucl

References




Getting Started: