2016年7月19日 星期二

scala compiler -classpath with multiple JAR files

scala compiler  -classpath  with  multiple JAR files


1. To compile a scala file and include a Jar file, enter the following command line:

scala  -classpath  /home/user/jarFile.jar   scalaFile.scala


2. To compile a scala file and include multiple Jar file, enter the following command line:

In Linux OS:
scala  -classpath  "/absolute/path/jarFile1.jar:/absolute/path/jarFile2.jar"   scalaFile.scala

In Winsows OS:
scala  -classpath  "C:\absolute/path/jarFile1.jar;C:/absolute/path/jarFile2.jar"   scalaFile.scala






scala 多個jar包編譯 

1.scala 編譯時僅有引用一個jar包:

scala  -classpath  /home/user/jarFile.jar   scalaFile.scala

2. scala 編譯時僅有引用一個jar包:
在Windows底下是分號要注意,Linux則是冒號,也要注意分號跟冒號分隔前後不可以有空白,也要使用絕對路徑,例如:~/xxx/yyy/filejar.jar 是不可以的。

In Linux OS:
scala  -classpath  "/absolute/path/jarFile1.jar:/absolute/path/jarFile2.jar"   scalaFile.scala

In Winsows OS:
scala  -classpath  "C:\absolute/path/jarFile1.jar;C:/absolute/path/jarFile2.jar"   scalaFile.scala

沒有留言:

張貼留言