Debugging, Compiling, and Running an Application in Windows
Scenario
Run applications in a Windows development environment after application code is developed. If the local and cluster service planes can communicate with each other, you can perform the commissioning on the local host.
Procedure
- Click (Reimport All Maven Projects) in the Maven Projects window in IntelliJ IDEA to import the Maven project dependency.
Figure 1 Reimport All Maven Projects
- Compile and run an application.
- Compile and run the application.
- Choose Maven Projects > Sample project name > Lifecycle > clean and double-click clean to run the clean command of Maven.
- Choose Maven Projects > Sample project name > Lifecycle > compile and double-click compile to run the compile command of Maven.
Figure 2 clean and compile tools of Maven
An example of the compilation result is as follows:"C:\Program Files (x86)\Java\jdk1.8.0_73\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\Users\Administrator\Desktop\huaweicloud-mrs-example-mrs-3.0.2\src\storm-examples\cql-examples "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.8\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.8\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.8\lib\idea_rt.jar=61287:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.8\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.8\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.2.8 -s C:\maven\apache-maven-3.5.3\conf\settings.xml compile [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building cql-examples 8.0.2 [INFO] ------------------------------------------------------------------------ [WARNING] The POM for ring:ring-core:jar:1.2.2 is missing, no dependency information available [WARNING] The POM for org.jboss.netty:netty:jar:3.10.4.Final is missing, no dependency information available [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cql-examples --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ cql-examples --- [INFO] Nothing to compile - all classes are up to date [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.171 s [INFO] Finished at: 2021-04-15T14:52:50+08:00 [INFO] Final Memory: 12M/29M [INFO] ------------------------------------------------------------------------ Process finished with exit code 0
- Run the application.
Right-click the CQLExample class in IntelliJ IDEA and click in the shortcut menu to run the application, as shown in Figure 3.
The application running success result may contain the following information:
"C:\Program Files (x86)\Java\jdk1.8.0_73\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.8\lib\idea_rt.jar=59898:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.8\bin" -Dfile.encoding=UTF-8 -classpath " ... SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.13.3/log4j-slf4j-impl-2.13.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Security framework of XStream not initialized, XStream is probably vulnerable. Security framework of XStream not initialized, XStream is probably vulnerable. Security framework of XStream not initialized, XStream is probably vulnerable. Security framework of XStream not initialized, XStream is probably vulnerable. 1609 [main] INFO c.h.s.c.s.p.ApplicationParser - start to parse cql : CREATE INPUT STREAM s (id INT, name STRING, type INT) SOURCE randomgen PROPERTIES ( "timeUnit" = "SECONDS", "period" = "1", "eventNumPerPeriod" = "1", "isSchedule" = "true") 1797 [main] INFO c.h.s.c.s.p.ApplicationParser - Parse Completed 1828 [main] INFO c.h.s.c.t.LazyTask - start to execute CREATE INPUT STREAM s (id INT, name STRING, type INT) SOURCE randomgen PROPERTIES ( 'timeUnit' = 'SECONDS', 'period' = '1', 'eventNumPerPeriod' = '1', 'isSchedule' = 'true' ) 1828 [main] INFO c.h.s.c.s.p.ApplicationParser - start to parse cql : CREATE OUTPUT STREAM rs(type INT, cc INT) SINK ConsoleOutput 1828 [main] INFO c.h.s.c.s.p.ApplicationParser - Parse Completed 1836 [main] INFO c.h.s.c.t.LazyTask - start to execute CREATE OUTPUT STREAM rs (type INT, cc INT) SINK ConsoleOutput 1836 [main] INFO c.h.s.c.s.p.ApplicationParser - start to parse cql : INSERT INTO STREAM rs SELECT type, count(id) as cc FROM s[RANGE 20 SECONDS BATCH] WHERE id > 5 GROUP BY type 1844 [main] INFO c.h.s.c.s.p.ApplicationParser - Parse Completed Security framework of XStream not initialized, XStream is probably vulnerable. Security framework of XStream not initialized, XStream is probably vulnerable. 1875 [main] INFO c.h.s.c.t.LazyTask - start to execute INSERT INTO STREAM rs SELECT type, count(id) AS cc FROM s[RANGE 20 SECONDS BATCH ] WHERE id > 5 GROUP BY type 1875 [main] INFO c.h.s.c.s.p.ApplicationParser - start to parse cql : SUBMIT APPLICATION example 1875 [main] INFO c.h.s.c.s.p.ApplicationParser - Parse Completed ... Process finished with exit code 0
- Compile and run the application.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.