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

Saturday, March 1, 2014

Sublime Text key bindings to jump out of parans, quotes and brackets like in Eclipse

One of the best features of Eclipse is having the "Enter" key move you outside of the parentheses, ticks, or brackets of a method.  That shortcut is so ingrained in me after a decade of Eclipse usage that I doubt I will ever be able to forget it.

Sublime Text is a great editor, but it doesn't have that shortcut.  I added it to Preferencs -> Key Bindings -> User

{ "keys": ["enter"], "command": "move", "args": {"by": "characters", "forward": true}, "context": 
 [
  { "key": "following_text", "operator": "regex_match", "operand": "[\"')}](.|$)", "match_all": true  } 
 ]
}

Sunday, August 8, 2010

Debugging Grails Apps in Eclipse

This is pretty simple to accomplish. Simply run "grails-debug run-app" instead of "grails run-app".

However, be sure to start the debugger in Eclipse! The app doesn't finish starting up until the debugger is attached. I spent some time wondering what was taking so long before putting that together.

Friday, April 30, 2010

Projects using GWT 1.5 or lower may only specify one entry point module to compile

Despite
Having the 2.0.3 GWT plugin installed
Never having used the 1.5 GWT plugin

I was getting the following error when clicking the GWT compile button :
 Projects using GWT 1.5 or lower may only specify one entry point module to compile
The solution was to move my GWT dependencies above my Maven dependencies.

Right click on the project -> Build Path -> Configure Build Path... -> Order and Export
Click on GWT SDK and Up until it is just below the JDK.

Please make sure the -vm option in eclipse.ini is pointing to a JDK

Ececutive summary : put the vm argument on the line after "-vm" in eclipse.ini.

I got the following dialog after a fresh Eclipse install :
The Maven Integration requires that Eclipse be running in a JDK, because a number of Maven core plugins are using jars from the JDK.
Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JREs are also using JDK installs.

The Installed JREs were already pointing to a JDK. I set my my eclipse.ini to : -vm C:\Sun\SDK\jdk
-vm C:\Sun\SDK\jdk\bin\javaw.exe

No luck.
Eclipsepedia has an eclipse.ini.

I put the vm location on the next line and everything worked.

Thursday, April 23, 2009

Useful Eclipse Plugins

I changed laptops recently. While updating Eclipse I realized that I did not have a list of the update sites I use. I figured this place was as good as any.

JBoss tools wraps some other useful plugins like Hibernate. It also has functionality for Seam and JBoss AS administration.

Seam leverages TestNG so the plugin is useful.

I have to use Groovy now.

Subclipse

Monday, February 16, 2009

illegal character: \64 when running Eclipse on Mac OSX

I develop on a Mac. We use Luntbuild to automate our builds.

We added our new project into Luntbuild this morning. Luntbuild kicked this back :
[package name]/ChannelDetails.java:24: illegal character: \64
compile [ javac ] @Entity
Nice.

Our team has used OS X, Ubuntu, XP and Vista. We had not encountered this problem before.

Why wouldn't Eclipse just standardize on one character encoding?

The solution is to change the encoding by right clicking on the project and choose Properties -> Resource.

There are panels for "Text file encoding" and "New text file delimiter."

Friday, January 2, 2009

SeamTest and Eclipse TestNG plugin

I encountered a small problem running a new SeamTest with Eclipse' TestNG plugin. The error was :

DEBUG [main] (KernelFactory.java:86) - Starting JBoss Kernel construction...
DEBUG [main] (KernelFactory.java:112) - Completed JBoss Kernel construction. Duration: 381 milliseconds
FAILED CONFIGURATION: @BeforeSuite startSeam
org.jboss.deployers.spi.DeploymentException: Unable to find bootstrap file: conf/bootstrap-beans.xml in classpath
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:181)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1025)
at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:916)
at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
... Removed 15 stack frames
The solution is pretty simple.

Open up the run configuration (the arrow next to the run button and choose "Run Configurations...")
The most recently run test should be highlighted. If not select it.
Choose the "Classpath" tab in the right side of the pane.
Click "User Entries" which should be in the center pane.
Click "Advanced' -> "Add Folders" -> OK and navigate to the "bootstrap" folder.
Click "Add Jars" and navigate to the "lib/test" folder and add all three jars.




Ok.

Tuesday, October 21, 2008

JBossWS Eclipse JUnit Error

I played with JBossWS for the first time this evening. I'm runningEclipse with JBossTools installed. It was easy enough to compile (Ant task) and import the project into Eclipse.

However, when I ran the tests I got a "Java Virtual Machine Error." The popup read "Could not find the main class. Program will exit." There's an post about this in the JBoss forums but no answer.

The tests run from Ant (even within Eclipse.) While running the tests from the command line a second time I noticed the following message :

tests-prepare: [echo] [echo] ----------------------------------------------- [echo] jboss.home = C:/tools/servers/jboss/jboss-4.2.3.GA [echo] excludesfile = C:\tools\jbossws\jbossws-native-3.0.4.GA\jbossws-native-bin-dist/tests/resources/test-exclude s-jboss423.txt [echo] java.home = C:\tools\java\j2se5.0u16\jre

It's pointing to the jre of my java home for some reason. I check the environment variable by running, echo %JAVA_HOME%, but it is pointing to the base install not just the jre.

Searching through the project for "jre" doesn't return anything. I hate to give up before I find a solution, but I had stuff to get done.

I ran the "ant eclipse" task again and imported into a fresh Eclipse install. No problem running the tests.

I'll try to reproduce and file a Jira issue. I thought I'd post this just in case anyone else is banging their head against the same wall.



Thursday, January 31, 2008

Server did not start after 50s

I got this error while starting up JBoss from Eclipse, 3.3 with the latest JBoss Tools installed (I haven't shelled out the $100 for Red Hat Developer Studio.)

"Timeout waiting for JBOSS 4.2 to start. Server did not start after 50s."

At December's AJUG meeting I saw a demonstration of Glassfish starting in under a minute, which was seriously impressive. However, Eclipse can't be pimping Glassfish, and while I am interested in giving Glassfish a look, I need this running now. Besides, I like JBoss.

I deleted a couple of the ear files that I wasn't working on, but I kept getting the timeout error. A quick Google, and I located the following folders in my EclipseDist\plugins directory :
  • org.eclipse.jst.server.generic.jboss_1.5.102.v20070608
  • org.eclipse.jst.server.generic.jboss_1.5105.v200709061325.
I edited the plugin.xml in the org.eclipse.jst.server.generic.jboss_1.5105.v200709061325 folder. The relevant parts were the serverType entries, startTimeout parameters.

<extension point="org.eclipse.wst.server.core.serverTypes">
<serverType
runtime="true"
class="org.eclipse.jst.server.generic.core.internal.GenericServer"
id="org.eclipse.jst.server.generic.jboss323"
initialState="stopped"
supportsRemoteHosts="false"
runtimeTypeId="org.eclipse.jst.server.generic.runtime.jboss323"
description="%jboss323serverTypeDescription"
launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
behaviourClass="org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"
name="%jboss323serverTypeName"
startTimeout="50000"
stopTimeout="15000"
hasConfiguration="false"
launchModes="run,debug,profile">
</serverType>
<serverType
runtime="true"
class="org.eclipse.jst.server.generic.core.internal.GenericServer"
id="org.eclipse.jst.server.generic.jboss4"
initialState="stopped"
supportsRemoteHosts="false"
runtimeTypeId="org.eclipse.jst.server.generic.runtime.jboss4"
description="%jboss4serverTypeDescription"
launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
behaviourClass="org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"
name="%jboss4serverTypeName"
startTimeout="50000"
stopTimeout="15000"
hasConfiguration="false"
launchModes="run,debug,profile">
</serverType>
<serverType
runtime="true"
class="org.eclipse.jst.server.generic.core.internal.GenericServer"
id="org.eclipse.jst.server.generic.jboss42"
initialState="stopped"
supportsRemoteHosts="false"
runtimeTypeId="org.eclipse.jst.server.generic.runtime.jboss42"
description="%jboss42serverTypeDescription"
launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
behaviourClass="org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"
name="%jboss42serverTypeName"
startTimeout="50000"
stopTimeout="15000"
hasConfiguration="false"
launchModes="run,debug,profile">
</serverType>
<serverType
runtime="true"
class="org.eclipse.jst.server.generic.core.internal.GenericServer"
id="org.eclipse.jst.server.generic.jboss5"
initialState="stopped"
supportsRemoteHosts="false"
runtimeTypeId="org.eclipse.jst.server.generic.runtime.jboss5"
description="%jboss5serverTypeDescription"
launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
behaviourClass="org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"
name="%jboss5serverTypeName"
startTimeout="50000"
stopTimeout="15000"
hasConfiguration="false"
launchModes="run,debug,profile">
</serverType>
</extension>

I changed the values to 180000 ms and JBoss booted just fine.

Blogged with Flock