eclipse

Oracle doesn’t want Java EE any more alvin October 5, 2017 - 8:38am

In case you missed the news, after that drawn-out legal battle about Java and Android, Oracle doesn’t want Java EE any more, and it was adopted by the Eclipse Foundation.

How to configure SBT to work with Eclipse

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a short recipe, Recipe 18.7, “How to configure SBT to work with Eclipse.”

Problem

You want to use Eclipse with a project you’re managing with SBT.

Solution

Use the Scala IDE for Eclipse project so you can work on Scala projects in Eclipse, and use the “sbteclipse” plug-in to enable SBT to generate files for Eclipse.

Setting a Scala application's command line parameters in Eclipse

I’ve been developing a new Scala application named Cato that requires some command-line parameters, and I just had to figure out how to configure Eclipse so my application would get those parameters. Doing this with Scala in Eclipse is different than configuring Java command line parameters in Eclipse, so I thought I’d share the recipe.

Fortunately it’s just a two-step process. First, click the drop-down icon next to the “Run” button and choose “Run Configurations”, as shown here:

ScalaTest 112: How to run ScalaTest unit tests in Eclipse

Problem: How do I use ScalaTest in Eclipse (or, How do I run my ScalaTest unit tests from Eclipse?)

Solution

I do a lot of work from the command line with Ant builds and similar things, but there are times I like to do things through Eclipse. Today I wanted to run my ScalaTest unit tests in Eclipse, and found this to be a straightforward task.

Besides Scala, Eclipse, and an Eclipse project, you'll need:

Using GitHub projects as Scala library dependencies with sbt and sbteclipse

Okay, this is pretty cool. With sbt, you can magically refer to dependencies that are set up as GitHub projects, and those projects don't need to have a jar file, they can just be a source code library. This means you can save your Scala libraries as source code to GitHub (like you normally would), then pull them into your other Scala projects simply by referencing them in your build.sbt file.

Assuming you're comfortable with sbt, here's a quick six-step example that shows how to pull a GitHub library into a simple Scala project:

How to list your Android devices (AVD and physical devices)

Android FAQ: How do I get a list of Android devices on my computer system (Android AVD devices and physical devices that are currently attached)?

At your command line, just use the adb devices command from the Android SDK:

adb devices

This will list all the names of AVD devices and physical devices currently installed on your computer.

Alaska lunar eclipse photos

Just a quick note that if you're interested in seeing photos of last night's lunar eclipse from Wasilla, Alaska, I just posted these Alaska lunar eclipse photos. My camera gear isn't great yet (a very good Pentax K-x, but no good lenses) but the large 4.4 MB image shows how clear the sky was here last night, as you can clearly see not only the orange-red moon, but many stars in the background as well.

Android + Eclipse: How to create a new Android Virtual Device (AVD) emulator

Android Eclipse FAQ: How do I create a new Android Virtual Device (AVD) emulator I can use in Eclipse?

There are at least two ways to create a new Android Virtual Device you can use in Eclipse: (a) Using the Eclipse Android GUI, and (b) using the Android command line.

How to create an AVD in Eclipse

Assuming your Android Eclipse work environment is set up properly, creating a new Android Virtual Device (AVD) is simple. Just follow these steps.