Skip to content

一个软连接管理工具。支持间接管理 NodeJS、Maven 和 Java 等几乎所有工具的版本,基于系统软连接实现,可高度自定义。A tool for managing system symbolic links. It supports version management for Java, Node.js, Maven, and more, and is based on system symbolic link.

Notifications You must be signed in to change notification settings

vudsen/symbolic-link-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

symbolic-link-manager

中文文档

A tool to manage system symbolic link, usually used to switch SDK version.

Install

  1. Download the latest version from the Release list and place the executable in any directory.
  2. Add the following environment variables: `SLINK_MANAGER_HOME
  • SLINK_MANAGER_HOME: the directory where the data is stored.

Tip

When you are done, it is recommended that you add the Path path for easy access. Consider renaming the executable to slm.exe (Windows), slm (Linux).

Example

Switch Java version

We have two Java here:

  • C:\Program Files\Java\jdk-17
  • C:\Program Files\Java\jdk8u432-b06

Manage these version by the command below:

# Declare a (symbolic) link,which name is `java`
slm add link java

# Add a tag for the link
slm add tag java 17 "C:\Program Files\Java\jdk-17"
slm add tag java 8 "C:\Program Files\Java\jdk8u432-b06"

# Switch the tag
slm use java 17

After all, a symbolic link named java will be created, it will locate at $SLINK_MANAGER_HOME/app/. Now you should set your JAVA_HOME to this directory:

  • windows: %SLINK_MANAGER_HOME%\app\java
  • linux: $SLINK_MANAGER_HOME/app/java

Replace the SLINK_MANAGER_HOME if you don't set it in environment variable.

Note

Make sure you also add %JAVA_HOME%/bin(windows) / $JAVA_HOME/bin(linux) to your Path

Then reopen the terminal. You only need to reopen the terminal the first time you set up the configuration for it to take effect.

After all, check you java version:

java-switch

Switch the Maven version when switch the version of Java

When we switched to Java 17, automatically switch the Maven version to 3.8.8. And when using Java 8,switch Maven to 3.6.3

Maven directories:

  • D:\DevelopmentTool\apache-maven-3.6.3
  • D:\DevelopmentTool\apache-maven-3.8.8

Manage these two versions:

# Declare a (symbolic) link,which name is `maven`
slm add link maven

# Add a tag for the link
slm add tag maven 3.6 "D:\DevelopmentTool\apache-maven-3.6.3"
slm add tag maven 3.8 "D:\DevelopmentTool\apache-maven-3.8.8"

# Bind to Java (You should create it before you use.)
slm add bind java:17 maven:3.8
slm add bind java:8 maven:3.6

# Switch to maven 3.6
slm use maven 3.6

After this, set the environment variable MAVEN_HOME to %SLINK_MANAGER_HOME%\app\maven (windows).

Now, when you switch the Java version will switch bound Maven version too:

绑定

Switch Node.js version

NodeJS directories:

  • D:\DevelopmentTool\symbolic-link-manager\sdk\nodejs\node-v22.11.0-win-x64
  • D:\DevelopmentTool\symbolic-link-manager\sdk\nodejs\node-v20.18.0-win-x64

Manage these two versions:

slm add link node

slm add tag node 20 "D:\DevelopmentTool\symbolic-link-manager\sdk\nodejs\node-v20.18.0-win-x64"
slm add tag node 22 "D:\DevelopmentTool\symbolic-link-manager\sdk\nodejs\node-v22.11.0-win-x64"

slm use node 20

Add the Path variable: D:\DevelopmentTool\symbolic-link-manager\app\node. If you have set the SLINK_MANAGER_HOME, you can use %SLINK_MANAGER_HOME%\app\node instead.

Other

You can add -h or --help to see help when you use it.

About

一个软连接管理工具。支持间接管理 NodeJS、Maven 和 Java 等几乎所有工具的版本,基于系统软连接实现,可高度自定义。A tool for managing system symbolic links. It supports version management for Java, Node.js, Maven, and more, and is based on system symbolic link.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages