D
D
daMage2014-09-11 19:31:58
Java
daMage, 2014-09-11 19:31:58

How to check that there are no compilation errors?

Hello. I use sublime. I wrote my own build system, but it does not take into account that the program may have errors and runs the old version.

errors=$(javac -d debug App.java 2>&1)
if [$errors != ""]
then exit

Swears, they say "syntax error: unexpected end of file". Tell me what I'm doing wrong

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2014-09-12
@daMage

Swears, they say "syntax error: unexpected end of file". Tell me what I'm doing wrong

You need to add fi to the end of the file to close the if-then:
if [$errors != ""]
then exit
fi

B
bromzh, 2014-09-11
@bromzh

Just use Maven, Gradle or the like. This is not only a build system, these are tools for full project life cycle management: dependency autoloading, build, packaging, deployment, a bunch of plugins for different needs.
In the sublime for the build, specify the line "maven clean compile run:run" or "maven clean package run:run" , there are many options. Well, or use an IDE, for large projects (especially in java), the sublime is not suitable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question