Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Sunday, 30 December 2012

Eclipse GUI freezes...

soution: increase vm memory...I have seen great improvement!!
Edit eclipse.ini and set:
-vmargs
-Xms1024m
-Xmx2048m


Tuesday, 25 December 2012

Eclipse debugging ...

$ eclipse -debug -console -clean

See the logs in the workspace: .metadata/.log

Saturday, 10 December 2011

Friday, 9 December 2011

Eclipse: change font size on console

Window > Preferences > General > Appearence > Colors and Fonts > Debug > Console font

Friday, 25 November 2011

Eclipse: automatically discover new files (refresh)

When I add a file to my project from Nautilus/shell I want Eclipse to automatically discover it without having to refresh my project each time....

solution: Window > Preferences > General > Workspace > Refresh using native hooks or polling

Wednesday, 23 November 2011

Eclipse+Maven: What if a project depends from another project?

Update on 24 Nov 2011: Unfortunately it seems that every time I change A I have to execute the cmd "mvn install" on A and refresh B to see the changes....any ideas?

Assume Project B needs Project A to compile and execute... We want whenever we modify code in A then B to get updated...An easy solution would be to add the jar of A in WEB-INF/lib of B but every time we changed A we would need a manual "mvn package".

Senario: B depends on A

Assuming the pom.xml of A is:

<project ...
 <groupId>CORE</groupId>
 <artifactId>CORE</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>jar</packaging>
 <name>CORE</name>
...
</project>

install A on local repository:

on A: mvn clean install

Add a as dependency on B's pom.xml:

<dependency>
 <groupId>CORE</groupId>
 <artifactId>CORE</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <scope>compile</scope>
</dependency>

updates B's Eclipse project configurations (i.e. .classpath):

$ mvn eclipse:eclipse

[INFO] B's .classpath after 'mvn eclipse:eclipse':

<classpath>
  <classpathentry kind="src" path="src/main/java"/>
  <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
  <classpathentry kind="output" path="target/classes"/>
  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
  <classpathentry kind="var" path="M2_REPO/com/maventest/mytest/1.0-SNAPSHOT/mytest-1.0-SNAPSHOT.jar"/>
  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
</classpath>
The above .classpath has been taken from the references...

[TROUBLESHOOTING] If you get in Eclipse the error "Classpath entry ... jar will not be exported or published. Runtime ClassNotFoundExceptions may result."

On Eclipse right click on project B > Java Build Path > Order and Export > select all!

Also check Java Build Path > Libraries and

Deployment Assembly

[TROUBLESHOOTING] If you the in Eclipse the error "implementation of version 6.0 of project facet"

edit .settings/org.eclipse.wst.common.project.facet.ccore.xml (assuming you use Tomcat 7.0):
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <runtime name="Apache Tomcat v7.0"/>
  <fixed facet="jst.web"/>
  <fixed facet="wst.jsdt.web"/>
  <fixed facet="java"/>
  <installed facet="jst.web" version="3.0"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
  <installed facet="jst.jsf" version="2.0"/>
  <installed facet="java" version="1.6"/>
</faceted-project>

[TROUBLESHOOTING] If you get the error that the MANIFEST.MF is not found...

Edit pom.xml in orer the build process to create the MANIFEST.MF (it must exist - see wikipedia):

   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.3.1</version>
    <!-- <configuration> -->
    <!-- <useDefaultManifestFile>true</useDefaultManifestFile> -->
    <!-- </configuration> -->
    <configuration>
     <archive>
      <index>true</index>
      <manifest>
       <addClasspath>true</addClasspath>
      </manifest>
      <manifestEntries>
       <mode>development</mode>
       <url>${pom.url}</url>
       <key>value</key>
      </manifestEntries>
     </archive>
    </configuration>
   </plugin>

References:

Monday, 7 November 2011

How to create a class diagram from existing java code

  • 1. Install Eclipse plugin AmaterasUML
  • 2. File > New > Other... > AmaterasUML > Class Diagram > drag 'n' drop in canvas the java classes you want

How to install AmaterasUML in Eclipse

AmaterasUML is an Eclipse plug-in for drawing UML class-diagram, and UML sequence-diagram.

Requirements: in Eclipse: Help > Install new software ... > Indigo): GEF

  1. download AmaterasUML (AmaterasUML_1.3.3.zip) from the link
  2. unzip it and put all jar files into in ECLIPSE_PATH/plugins
  • net.java.amateras.xstream_1.3.3.jar
  • net.java.amateras.umleditor_1.3.3.jar
  • net.java.amateras.umleditor.java_1.3.3.jar

Eclipse (Indigo): Install EMF

Install EMF
Help > Install new software... > Work with: Indigo - http://download.eclipse.org/releases/indigo > "Modeling" > select "EMF - Eclipse Modeling Framework SDK" and "Ecore Tools"

http://www.vogella.de/articles/EclipseEMF/article.html

Eclipse: backup plugins

scenario: backup eclipse plugins > remove eclipse > install eclipse > install eclipse plugins

how to backup (export) eclipse plugins
File > Export > Install > Installed Software Items to File

how to restore (import) eclipse plugins
File > Import > Install > Install Software Items from File

Friday, 4 November 2011

java.lang.ClassNotFoundException: org.springframework.web.*

error:
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

Solution 1:
delete server (tested with Tomcat) and recreate it+deploy the project
Solution 2:
Make sure that in Eclipse the Maven Dependencies are included in the output war (right clich the project and go to Deployment Assembly/Add/Maven Dependencies )
Note:
The classes org.springframework.web.* are included in spring-web-#.#.#.jar (for me spring-web-3.0.5.RELASE.jar) but I already had this jar

Eclipse autocomplete doesn't work for JSF .xhtml pages

In eclipse enable the JSF facelet (tested for Eclipse Indigo) References http://stackoverflow.com/questions/2136218/eclipse-autocomplete-content-assist-with-facelets-jsf-and-xhtml

specify VM for eclipse to start (Oracle VM instead of the default OpenJDK)

Eclipse start with OpenJDK. The problem is that it often crashes. Solution: set up eclipse to start with Oracle Java edit eclipse.ini and append the lines
-vm
/usr/bin/java
assuming that java executable is on /usr/bin/java (execute 'whereis java' to wee where it is)

Wednesday, 2 November 2011

Eclipse/Maven error: "Dynamic Web Module 3.0 requires Java 1.6 or newer. "

solution Add in pom.xml
 <build>
  <plugins>

   <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.0.2</version>
    <configuration>
     <source>1.6</source>
     <target>1.6</target>
    </configuration>
   </plugin>

  </plugins>
 </build>

Thursday, 23 June 2011

Set up Eclipse for Ogre

Create new C++ project in eclipse.

Right click the project and select Properties:
* C/C++ Build
  * Settings
  * Tool Settings
  * GCC C++ Compiler
  * Includes
    + Include paths (-l)
      - /usr/local/include/OGRE
      - /usr/include/OIS
  * GCC C++ Linker
  * Libraries
    + Libraries (-l)
      - OgreMain
- OgreTerrain
- OgrePaging
- OgreRTShaderSystem
      - OIS
      //- BulletCollision
      //- BulletDynamics
      //- LinearMath
    + Libraries (-L)
      - /usr/local/lib
      - /usr/lib
      (/usr/local/lib/ must be before /usr/lib because in Ubuntu
      in /usr/lib is the deb libogre-dev v.1.6.4 and
      in /usr/local/lib is the manual installation and
      we want the second one to take precedence)