Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Ontology JAVA SDK Development Environment in IDEA under Ubuntu 14.04

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to build an Ontology JAVA SDK development environment in IDEA under Ubuntu 14.04. I hope you will get something after reading this article. Let's discuss it together.

Install Java

Download Java

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Open the link above to download a specific version of Java8. The author chose jdk-8u172-linux-x64.tar.gz.

Configure Java environment variables

Extract the jdk-8u172-linux-x64.tar.gz to the specified directory

Blockchain@ThinkPad-T460:~$ tar-zxvf ~ / Downloads/jdk-8u172-linux-x64.tar.gz-C ~

Edit the .bashrc file in the home directory

Blockchain@ThinkPad-T460:~$ vim / .bashrc

Add at the end of the file

Export JAVA_HOME=$HOME/jdk1.8.0_172export JRE_HOME=$ {JAVA_HOME} / jreexport CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / libexport PATH=$PATH:$ {JAVA_HOME} / bin

Make the configuration effective immediately

Blockchain@ThinkPad-T460:~$ source / .bashrc

View Java version

Blockchain@ThinkPad-T460:~$ java-versionjava version "1.8.0mm 172" Java (TM) SE Runtime Environment (build 1.8.0_172-b11) Java HotSpot (TM) 64-Bit Server VM (build 25.172-b11, mixed mode) install Maven

Download Maven

Http://www-eu.apache.org/dist/maven/maven-3/

Open the above link

Go to the appropriate directory and download a specific version of Maven The author chose apache-maven-3.3.9-bin.tar.gz.

Configure Maven environment variables

Extract the apache-maven-3.3.9-bin.tar.gz to the specified directory

Blockchain@ThinkPad-T460:~$ tar-zxvf ~ / Downloads/apache-maven-3.3.9-bin.tar.gz-C ~

Edit the .bashrc file in the home directory

Blockchain@ThinkPad-T460:~$ vim / .bashrc

Add at the end of the file

Export MAVEN_HOME=$HOME/apache-maven-3.3.9export PATH=$PATH:$ {MAVEN_HOME} / bin

Make the configuration effective immediately

Blockchain@ThinkPad-T460:~$ source / .bashrc

View Maven version

Blockchain@ThinkPad-T460:~$ mvn-versionApache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00) Maven home: / home/blockchain/apache-maven-3.3.9Java version: 1.8.000172, vendor: Oracle CorporationJava home: / home/blockchain/jdk1.8.0_172/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "4.4.0-116-generic", arch: "amd64", family: "unix"

Configure Maven Mirror

Edit the settings.xml under the MAVEN_HOME,conf folder

Blockchain@ThinkPad-T460:~$ vim $MAVEN_HOME/conf/settings.xml

Locate the mirrors mirror node and add the mirror node, as shown below:

Alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central builds Ontology JAVA SDK development environment

Download ontology-java-sdk

Blockchain@ThinkPad-T460:~/GitClone$ git clone https://github.com/ontio/ontology-java-sdkCloning into 'ontology-java-sdk'...remote: Counting objects: 2322, done.remote: Compressing objects: 100% (57delta 57), done.remote: Total 2322 (delta 19), reused 47 (delta 12), pack-reused 2240Receiving objects: 100% (2322 KiB), 592.08 KiB | 302.00 KiB/s, done.Resolving deltas: 100% (1264 delta), done.Checking connectivity... Done.blockchain@ThinkPad-T460:~/GitClone$ ls-lttotal 4drwxrwxr-x 5 blockchain blockchain 4096 April 26 16:56 ontology-java-sdk

Ontology-java-sdk is a Maven project.

Download IDEA Community Edition

Https://www.jetbrains.com/idea/download/previous.html, click the link

The author chose ideaIC-2017.3.5-no-jdk.tar.gz. Extract the compressed file

Blockchain@ThinkPad-T460:~$ tar-zxvf ~ / Downloads/ideaIC-2017.3.5-no-jdk.tar.gz-C ~

Start IDEA

Blockchain@ThinkPad-T460:~$ idea-IC-173.4674.33/bin/idea.sh

Enter the following interface

Click Open to open the ontology-java-sdk project downloaded above.

Click OK. At this point, it will enter the project. Click File-> Settings in the upper left corner

In the following figure, select the Maven path installed in the previous step, and then confirm.

Right-click pom.xml, click Reimport in the Maven option, and Maven will pull the dependent Jar package.

At this point, the Java SDK development environment for Ontology has been built. Next, let's run some of these examples.

Run the AccountDemo instance under the demo package.

Run the Demo instance under the demo package.

Run the ECIESDemo instance under the demo package.

Run the MakeTxDemo instance under the demo package.

Run the OntAssetDemo instance under the demo package.

Run the RecordTxDemo instance under the demo package.

After reading this article, I believe you have some understanding of "how to build an Ontology JAVA SDK development environment in IDEA under Ubuntu 14.04". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report