JAVA - Create a file in linux server
If the machine "10.30.10.117" is on your local network and if you have the permission to create file on that machine then the problem is
File folder = new File("//10.30.10.117:/home/images/784/");
File file = new File("//10.30.10.117:/home/images/784/1508-1-N.png");
folder.mkdirs();
file.createNewFile();
Before write to file create it.
But if the machine "10.30.10.117" is on external network for your machine then you can't create a file or folder directly from your machine. You need ftp connection vb...
How do I create a Makefile that will compile and run java code with command line arguments?
JC = javac
JCR = java
.SUFFIXES: .java .class
.java.class:
$(JC) $*.java
CLASSES = \
MainDriver.java \
FSA.java \
State.java \
Transition.java
TXT_FILES = \
test1.txt \
test2.txt \
test3.txt \
default: classes exec-tests
classes: $(CLASSES:.java=.class)
clean:
$(RM) *.class *~
exec-tests: classes
set -e; \
for file in $(TXT_FILES); do $(JCR) MainDriver $$file; done;
.PHONY: default clean classes exec-tests
java makefile make: Nothing to be done for 'default'
That means your classes already exist (therefor nothing is to be done). If you want to rebuild anyway, do a make clean
first. Like,
make clean
make
As for jar'ing your compiled classes, you have no jar
target.
Related Topics
When to Use Generic Methods and When to Use Wild-Card
How to Set Addsnapshotlistener and Remove in Populateviewholder in Recyclerview Item
Java 7 Language Features with Android
How to Return an Array from Jni to Java
Using Static Variables in Android
Differencebetween List and Arraylist
How to Parse JSON Array with Gson
Format Float to N Decimal Places
Finish All Previous Activities
How to Connect Remote MySQL Database in Android Using Jdbc
Android Recyclerview Addition & Removal of Items
Any Good Orm Tools for Android Development
Android Studio Google Jar File Causing Gc Overhead Limit Exceeded Error