, thinking it would be useful, but still managed to get stuck on the instructions.
After punching in the java -version in the command prompt on my Win10, it spit out ‘java version 1.8.0_102’. That was downloaded from the link provided on the ‘how to’ page linked above. I’m not sure if it’s outdated or not. Then I proceeded with the ‘java -jar server-0.16.4.jar -dataFolder /path’ command, with an error popping up saying:
Error: Unable to access jarfile server-0.16.4.jar.
I don’t know if this part of the Blynk package was intended to picked up and implemented by server noobs but the instructions look a little barren compared to what I youtubed:
I’m not sure if the above works, as I didn’t want to jack with stuff I knew little about but I did watch the video and the steps seem more numerous than those outlined in the quick setup guide.
Anyways, I just want to be able to set up my own server and see if it’s something I want in the long term or if it’s optional. Any insight on this matter would be nice.
@aop you need to either specify full path to jar file or go to dir with jar and run from there. Also dataPath should be without space or escaped properly.
I just went to the directory file and double-clicked the server-0.16.4.jar file/icon. Afterwards, a set of Static and Logs folders appeared within that folder, so I’m assuming that’s the quick setup. If not, tell me so. If it is, what’s next?
Yeah I didn’t know to include cd C:\Users\Jacob\Documents\Blynk Server before entering the java -jar server-0.16.4.jar -dataFolder /path command. Thanks for the heads up! Wouldn’t it just be easier for others when reading the Windows instructions to just have them find the Java Server file through the search tab and double click it?
^I love the stacked library of various emoji’s. Whoever thought of including that, here in the community section, at Blynk, bravo!
Place your jar file in any folder. Open Notepad and place these lines of code:
@echo off
echo Starting Blynk Server...
echo Your working directory is=%~dp0
cd /D %~dp0
java -jar server-0.16.4.jar -dataFolder /path
IF /I "%ERRORLEVEL%" NEQ "0" (
ECHO Server failed to started
)
echo Server started successfully.....
Save as AnyName.cmd (in the same folder of your server jar file). Modify the server file version if needed.
Whenever you want to start the server , right click on AnyName.cmd and Run as administrator
Don’t use the batch file above without editing the following line:
java -jar server-0.16.4.jar -dataFolder /path
You need to change /path to your actual path in unix style format even though you are using Windows.
Also you need to keep revising the server version, so -0.16.4 went to -0.17.0 to 0.17.2 etc. One fix for this would be to simply ensure the latest jar file is just called server.jar when you copy it into the directory from Github.
So if you want to store your data in C:\BlynkStuff\2016\data and you are using a fixed name for all versions of the server the batch file line would become:
Hi all… if I may just jump in here. I am also running the local server 0.17.2 on a windows machine and I’m having an unusual (to me) problem when I use @wbadry batch loader.
When I run the .cmd file the Windows Command Window opens and the batch executes. When it is finished the cmd window remains open and the Server runs fine and is shown in the “Task Manager” processes.
Communication and logon is normal with my mobile device BUT… If I close the cmd window the server process terminates or if I terminate the process the cmd window closes.
I am using the above batch file with the following command java -jar server-0.16.4.jar -dataFolder \Blynk\Server\Data
Notice @Costas that I used the windows backslash for folder delineation… could that be a problem?
The solution is probably a butt-kicker but I’m afraid it’s outside my area of expertise.
@modicon1 with the tests I did it needs to be Unix style not Windows style for directory structure. If it was Windows style you would probably need the drive letter.
Did some googling and there are ways to run the batch with the cmd window hidden but it seemed quite convoluted and not a universal solution.
Having the command window remain open when running JAVA processes seems to be normal although I don’t recall it being there for previous server versions.
The best work-around I found was to create a shortcut to the batch and modify the shortcut properties to run minimised as administrator.
@modicon1 yes I minimize the command windows not closing it. Command window acts like the host for java app. If you terminate the shell, the server process will be automatically terminated.
OK… I’m using the cdm file but what happens is that the command opens and closes very fast with something written that is impossible to read, someone knows what is wrong?