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

Friday, April 7, 2017

Eclipse - Setup - How to set java for during eclipse start up

Description: 
I faced starting up Eclipse IDE which complaining about old java version. The java version in my environment was 1.6 which is needed to run old programs. I installed Java 8 did below thing to make it work.

Environment:
Eclipse version - neno.3
Old java version - 1.6.0_29
New Java version - 1.8.u111

Steps to follow:

  1. Find and write down the Java 8 installation location (for me, it was in e:\java\)
  2. Go to location where eclipse is installed
  3. Open file 'eclipse.ini' with any file editor
  4. Type the below lines - (change the java path)
    -vm
    e:\Java\jdk1.8_u111\bin\javaw.exe
  5. Save the change
  6. Execute the eclipse.exe


Saturday, January 10, 2015

Eclipse - Ubuntu - Setup - Install Eclipse on Ubuntu OS

Environment:
OS: Ubuntu 14.04 64-bit
Eclipse: Luna 4.4 64-bit


Install Eclipse:


  • Make sure Java is installed. I have another post how to do so (see Resource-01)
  • Download Eclipse installer. URL="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/R/eclipse-jee-luna-R-linux-gtk-x86_64.tar.gz"
  • Extract the file.
    using command in terminal: tar -zxvf eclipse-jee-luna-R-linux-gtk-x86_64.tar.gz
    using Archive Manager UI tool
  • Copy extracted folder to "/opt".
    Command: sudo mv eclipse /opt
Start eclipse:
  • From terminal
    1. Open terminal (shortcut ctrl+alt+t)
    2. Go to location "/opt/eclipse"
    3. Run executable "./eclipse"
  • From file browser
    1. Open file browser
    2. Go to location "/opt/eclipse"
    3. Double click on eclipse icon
  • Create desktop file and install. This will help opening eclipse from unity launcher (see Resource-02, Resource-03)
    1. Create eclipse desktop file
      Command: "gedit eclipse.desktop"
    2. Type following the file

      [Desktop Entry]
      Name=Eclipse Luna
      Type=Application
      Exec=/opt/eclipse/eclipse
      Terminal=false
      Icon=/opt/eclipse/icon.xpm
      Comment=Java Integrated Development Environment
      NoDisplay=false
      Categories=Development;IDE;
      Name[en]=Eclipse Luna

      Note: See Note-01, Note-03 for more information if desktop file not behaving as expected
    3. Execute the desktop file
      Command: "sudo desktop-file-install eclipse.desktop"
    4. Give eclipse permission to modify osgi file
      Command: "sudo chown -R $USER:$USER
      /opt/eclipse/configuration/org.eclipse.osgi
      "
    5. Give desktop file permission to execute (see Note-02)
      Command: "chmod a+x eclipse.desktop"
Notes:
  1. If icon is not displayed - icon file name cannot have extension unless full path is specified
  2. If desktop file is not displaying name mentioned in file. Showing 'eclipse.desktop' instead of 'Eclipse Luna' - desktop file's execution permission not set.
  3. Getting 'There was an error launching the application' - value mention in desktop file for Exec is not correct

Resources:
  1. How to install java - http://peerprogrammer.blogspot.com/2014/02/java-setup-install-java-in-ubuntu.html
  2. unity launcher - https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
  3. How to create desktop file - http://askubuntu.com/questions/281293/creating-a-desktop-file-for-a-new-application

Thursday, October 30, 2014

Eclipse - Configuration - how to change project type

Background:
I have imported a java project (not sure the project was created as Java Project) in Eclipse but it wasn't giving any IntelliSense (code suggestion), errors were not marked, build automatically etc. "(Project) - Properties" (alt + enter) was not providing all the option usually seen in regular java project. That led me to think that eclipse is not able to recognize this project as valid java project.

Solution:
Change the project type solved the issue. Actually I had to deselect 'Java' - Save and than open again and select 'Java' to make it work.

How to change project type in eclipse: 
1. "(Project) - Properties" (alt + enter)
2. From left navigation panel, select 'Project Facets'
3. From right side, select 'Java' and appropriate version from drop down. 
4. Apply and Save

When selecting 'Java' in project facet first time:
When 'Java' is selected as first time facet for a project, a new link 'Further configuration available...' will appear at the bottom. That will allow to specify source and build path. Always good idea to check that link

Few shortcuts:
1. "Alt + Enter" - will open the Project Properties