Skip to content

Code and IDE things (Eclipse, Java)

Catharine McGhan edited this page Jun 28, 2017 · 8 revisions

Table of Contents

Programming-related concepts

Java

Eclipse:

  • Dependencies: Install OpenJDK 7+ or 8+, or Oracle Java first
  • Native eclipse version under Ubuntu 16.04 (sudo apt install eclipse) as of 2017-06-22 is: 3.8.1
  • Install newest version of eclipse (3.8.1? see link) manually to /home/$USER/eclipse/java-neon via:
    • mkdir -p ~/Downloads/eclipse-neon
    • cd ~/Downloads/eclipse-neon
    • wget http://ftp.osuosl.org/pub/eclipse/oomph/epp/neon/R2a/eclipse-inst-linux64.tar.gz
    • tar xvzf eclipse-inst-linux64.tar.gz
    • cd eclipse-installer
    • ./eclipse-inst
    • Select "Eclipse IDE for Java Delveopers" to start with
    • Run via: /home/$USER/eclipse/java-neon/eclipse/eclipse
    • Select (new) workspace (so that incompatibilities will not result): /home/$USER/workspace-neon
    • Get newest release software plugins via: http://download.eclipse.org/releases/neon/
      • Some things one might want include (see link): "General Purpose Tools->e(fx)clipse - IDE"
  • You can show the "path" (Java breadcrumbs) of any file open in the main tab via "Alt-Shift-B" (see link)
  • Show workspace location in title bar by adding "-showlocation" to eclipse.ini file (see link)
  • Show problems in more detail than the console by: "Window->Show View->Problems"
  • Run a .launch file: in the Project Explorer click on your project folder, then select "Run->Run"
    • alt. way of doing this (from link: right click on the Name_of_File.launch file, select "Run As->Name_of_File"

Java at the commandline:

  • Compile a .java file into a .class file: javac name_of_file.java
  • Run a name_of_file.class file: java name_of_file
  • Compile a .class file into a .jar file:
    • jar -cvfe name_of_file.jar <MainClass> name_of_file.class
    • -OR- by creating a manifest file MANIFEST.mf (for multiple class+jar compilation) and then: jar -cvfm name_of_file.jar MANIFEST.mf name_of_file.class
  • Run a .jar file: java -jar name_of_file.jar
Reference: link

Python (to-be-added)

...


C++ (to-be-added)

...