顯示具有 eclipse 標籤的文章。 顯示所有文章
顯示具有 eclipse 標籤的文章。 顯示所有文章

2017年3月29日 星期三

[Java] How to import external library

Import external library into .m2 repository.
mvn install:install-file \
 -Dfile=/home/happy/workspace/Java-WebSocket/dist/java_websocket.jar \
 -DgroupId=org.java-websocket \
 -DartifactId=Java-WebSocket \
 -Dversion=1.3.1 \
 -Dpackaging=jar


Java-WebSocket will install in following folder.
/home/happy/.m2/repository/org/java-websocket/Java-WebSocket/1.3.1


Add the following command tell project which external library will be used.

import org.java_websocket.WebSocketImpl;



Add following script into pom.xml file.

<!-- https://mvnrepository.com/artifact/javax.websocket/javax.websocket-api -->
<dependency>
    <groupId>javax.websocket</groupId>
    <artifactId>javax.websocket-api</artifactId>
    <version>1.1</version>
</dependency>

Execute mvn clean install will install javax.websocket-api.

Reference:

2017年3月28日 星期二

[Eclipse] maven compile failure

Q:
Right click on the mouse, and select “Run as –> maven install” will compile failure.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project alexa-skills-kit-samples: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Unable to load the mojo 'resources' in the plugin 'org.apache.maven.plugins:maven-resources-plugin:2.6'. A required class is missing: org.apache.maven.plugin.resources.ResourcesMojo



A:
Remove maven from following folder.
/home/happy/.m2/repository/org/apache/maven/


Start to recompile once more time. Eclipse will download relative dependence about maven to “/home/happy/.m2/repository/org/apache/”.

Reference:

insert into SessionTime [Sale_date, Number] value [20170320, 9y8GTstx8z1T]

2017年3月26日 星期日

[Eclipse] Unrecognized VM option ‘UseStringDeduplication’

Q:
[happy@localhost ~]$ eclipse
Unrecognized VM option ‘UseStringDeduplication’
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

A:
Because JDK version is old one (1.7.0). So need to change JDK to 1.8.0. When execute eclipse will understand what is option ‘UseStringDeduplication’.


[happy@localhost ~]$ java -version
java version “1.7.0_111”
OpenJDK Runtime Environment (IcedTea 2.6.7) (Arch Linux build 7.u111_2.6.7-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.111-b01, mixed mode)

Download JDK 1.8.0
After download it. Please decompress it. And set the PATH to it binary folder.


export PATH=/home/happy/APP/jdk1.8.0_121/bin/:$PATH


Reference:

2011年8月23日 星期二

[eclipse] How to Configure Eclipse for C/C++




Install the C/C++ Development Tools (CDT) for Eclipse

Except where noted you can simply accept the defaults.
Eclipse 3.7/Indigo, 3.6/Helios, and 3.5/Galileo



  1. Log in to your regular user account


  2. Start Eclipse.


  3. Select Help → Install New Software...

  4. Before going further, check that you do not actually have the C/C++
    plug-in installed. While in the Install New Software dialog, click on "What is already installed?")
    If so, you may skip ahead to Writing Your First Program below.


  5. Carefully type this url: http://download.eclipse.org/tools/cdt/releases/indigo
    in the Work with: field. After several seconds, two
    items will appear. Check both items.


  6. Click Next and OK to continue installing CDT. Accept trust certificates
    as needed and continue despite any security warnings that may pop up.

  7. Answer "yes" to the "restart Eclipse?" question.

  8. When Eclipse next opens you will see an Overview screen. If you want to find out more about any part of Eclipse, select that
    category; otherwise click on the arrow icon to proceed
    to workbench.



How to Configure Eclipse for C/C++