First, put the GitHub repository https://github.com/kamoshika9999/HelloRemote.git
cd /home/pi
wget https://download.bell-sw.com/java/13/bellsoft-jdk13-linux-arm32-vfp-hflt.deb
sudo apt-get install ./bellsoft-jdk13-linux-arm32-vfp-hflt.deb
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo apt-get install samba
sudo nano /etc/samba/smb.conf
[raspberry_pi]
comment = Share
path = /home/pi/samba
public = yes
read only = no
browsable = yes
force user = pi
sudo mkdir /home/pi/samba
sudo systemctl restart smbd
Launch configuration Main-HelloRemote Export destination Raspberry Pi samba folder + file name "fxtest.jara" * File name is decided appropriately Check Save as Ant Script The location is the same as the workspace of the project, and the file name is build.xml. 3. When you press Finish, a warning will appear, but it is OK as it is 4. Right-click on a blank space in Package Explorer to refresh 5. Right click on build.xml and open it with-ANT editor
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="remotedebug" name="Create Runnable Jar for Project HelloRemote">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<!--define folder properties-->
<property name="dir.buildfile" value="."/>
<property name="dir.workspace" value="${dir.buildfile}/.."/>
<property name="dir.jarfile" value="//192.168.9.112/raspberry_pi"/>
<property name="raspberrypi" value="192.168.9.112" />
<property name="raspberryfolder" value="/home/pi/samba" />
<property name="username" value="pi" />
<property name="password" value="raspberry" />
<target name="create_run_jar">
<jar destfile="${dir.jarfile}/fxtest.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="application.Main"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.buildfile}/bin"/>
<zipfileset excludes="META-INF/*.SF" src="C:/OPENCV3/pleiades-4.8/pleiades/eclipse/plugins/org.eclipse.fx.ide.css.jfx8_3.3.0.201805280700.jar"/>
</jar>
</target>
<target name="remotedebug" depends="create_run_jar">
<echo>"Starting ${raspberrypi}:${raspberryfolder}/${jar.filename} in debug mode"</echo>
<sshexec trust="true" host="${raspberrypi}" username="${username}" password="${password}" failonerror="true" usepty="true" command="DISPLAY=:0 java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=*:4001,suspend=y -classpath ${raspberryfolder} -jar ${raspberryfolder}/fxtest.jar" />
</target>
</project>
6-1. Explanation of the contents "Default =" remotedebug "" specifies the target to be executed last
<project default="remotedebug" name="Create Runnable Jar for Project HelloRemote">
"Target name =" remotedebug "depends =" create_run_jar "" depends on the target to be executed before this target In other words, the executable jar file is created first and deployed to Raspberry Pi.
<target name="remotedebug" depends="create_run_jar">
The part that executes commands with ssh using jsh 2 points DISPLAY =: 0 Nothing is displayed without this specification address = *: 4001 *: means access from any host. 4001 is a port number and can be changed if there is space
<sshexec trust="true" host="${raspberrypi}" username="${username}" password="${password}" failonerror="true" usepty="true" command="DISPLAY=:0 java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=*:4001,suspend=y -classpath ${raspberryfolder} -jar ${raspberryfolder}/fxtest.jar" />
</target>
Download 7-1.jsch-0.1.55.jar and save it in the applicable folder
7-2. Right-click HelloRemote and import 7-3. General-Select File System and Next Check 7-4.jsch-0.1.55.jar and complete 7-5. Make sure you have jsch-0.1.55.jar in Package Explorer 7-6. Right click on build.xml and run-configure external tools 7-7. Click the new icon after selecting ant build 7-8. Select the user entry on the "Classpath" tab and click the Add JAR button 7-9. Expand the tree, select jsck-0.1.55.jar and click the OK button 7-10. Added to classpath 8. Run Ant build Press the execute button. If you see the following on the console, you are successful 8-1. You can change the source and execute it from the icon from the second time onwards
If you do an ANT build, you can execute "build-> deploy to Raspberry Pi-> standby in remote JVM" in one shot, which is very convenient. The introduction is long, but if you do not do this, you will lose a lot of time There is a way to work with Maven, but it will be another opportunity
Explain GPIO control of Raspberry Pi Mainly how to use PI4J
2020.0727 kamoshika It has nothing to do with this article, but ... I'll post a link to the main channel https://www.youtube.com/channel/UCbtzwsQhTuUzW3ERoBSYZDw/
Recommended Posts