File tree 2 files changed +7
-15
lines changed
2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,8 @@ We can then run the assembled JAR file with the `java` command. The variable
34
34
$COMMAND takes two values ` detect ` and `translate'.
35
35
36
36
```
37
- MAIN_CLASS=com.google.cloud.translate.samples.TranslateText
38
37
JAR_FILE=target/translate-1.0-SNAPSHOT-jar-with-dependencies.jar
39
- java -cp $JAR_FILE $MAIN_CLASS <detect|translate|langsupport> <text>
38
+ java -jar $JAR_FILE <detect|translate|langsupport> <text>
40
39
<optional_source> <optional_target>
41
40
```
42
41
@@ -52,16 +51,16 @@ Translate API Features:
52
51
53
52
* List the languages supported by the API
54
53
```
55
- java -cp $JAR_FILE $MAIN_CLASS langsupport
54
+ java -jar $JAR_FILE langsupport
56
55
```
57
56
58
57
* Detect input text language
59
58
```
60
- java -cp $JAR_FILE $MAIN_CLASS detect "$INPUT"
59
+ java -jar $JAR_FILE detect "$INPUT"
61
60
```
62
61
63
62
* Translate input text (with options)
64
63
```
65
- java -cp $JAR_FILE $MAIN_CLASS translate "$INPUT"
66
- java -cp $JAR_FILE $MAIN_CLASS translate "$INPUT" $SOURCE_LANG $TARGET_LANG
64
+ java -jar $JAR_FILE translate "$INPUT"
65
+ java -jar $JAR_FILE translate "$INPUT" $SOURCE_LANG $TARGET_LANG
67
66
```
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ limitations under the License.
21
21
<name >translate</name >
22
22
<url >http://maven.apache.org</url >
23
23
<properties >
24
+ <maven .compiler.target>1.8</maven .compiler.target>
25
+ <maven .compiler.source>1.8</maven .compiler.source>
24
26
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
25
27
</properties >
26
28
<parent >
@@ -62,15 +64,6 @@ limitations under the License.
62
64
</descriptorRefs >
63
65
</configuration >
64
66
</plugin >
65
- <plugin >
66
- <groupId >org.apache.maven.plugins</groupId >
67
- <version >3.3</version >
68
- <artifactId >maven-compiler-plugin</artifactId >
69
- <configuration >
70
- <source >1.8</source >
71
- <target >1.8</target >
72
- </configuration >
73
- </plugin >
74
67
</plugins >
75
68
</build >
76
69
</project >
You can’t perform that action at this time.
0 commit comments