Quantcast
Channel: JetBrains Developer Community : All Content - IntelliJ IDEA Users
Viewing all 5481 articles
Browse latest View live

Eclipse compiler custom warning


AspectJ: Cannot create new aspect

$
0
0
I am trying to use AspectJ in an Android app. I enabled AspectJ support from the plugins menu, added aspectjrt.jar as a dependency, and restarted the IDE. However, I am not seeing "Aspect" as an option from the "New" menu. How can I add an aspect to my project?

Stepping in debug is slow (AS3)

$
0
0

Stepping while debugging seems a tad slow (0.2 seconds-ish). This is the case for even very small projects.

Any ideas how I diagnose and fix this problem?

How do I get back scratch files I closed ?

$
0
0

Say you create a scratch file. It's named "scratch.9". When I close this scratch file, how can I get back the content ? I can't find a view of recent scratch files.

 

Many thanks

IntelliJ editor "wiggles"

$
0
0

This is something that's kind of hard to describe, but it drives me nuts! Sometimes, when editing code in IntelliJ editor, the whole codeview "wiggles" from right to left. not constantly, but now and then for no apparent reason. Please help me find the cause of this! It may seem as a silly little thing, but when you're writing code for hours, these little annoyances add up..

 

Since it's kind of hard to describe, I've made a little clip of the phenomenon..

Flex "Object not found". SDK not recognized?

$
0
0

It happens that I get a weird "Object not found" compile error in my program(s). It seems as if IntelliJ does not recognize the current Flex SDK. The problem usually arise after a reboot of the computer.

 

Workaround:
1 Delete swc's from bin folders (project contains 12 library modules and one module with 2 web-app)
2 Open Project Structure -> Platform Setting
3 Alter the name of the relevant SDK. Click OK (closing the Project Structure form seem important)
3 Reset the name of the relevant SDK. Click OK (closing the Project Structure form seem important)
4 Invalidate caches from the File menu.
5 Voila! That's it, my code compiles.

 

Suggestions appreciated!

Maven libraries in non-maven projects

$
0
0

We have a large non-maven Java project.  As well as this, we also have some smaller Maven projects and an Archiva repository.

 

I would like to use Maven libraries in the non-Maven project for snapshot and 3rd party dependencies.

 

I set this up - using 'Maven libraries' as dependencies for the modules in the non-Maven project.  So far so good.  However, there doesn't seem to be a check done for newer versions in Archiva.

 

For example, if I delete the artifact in my local Maven repository, nothing goes off and downloads it from Archiva (like what would happen if it was a Maven project).  I'm guessing (because I haven't been able to test it yet) that if a newer version existed in Archiva then that wouldn't be picked up either.

 

Is this expected behaviour?

 

The non-Maven project also uses Ivy (and we were using IvyIDEA plugin in IDEA), but this wasn't working very well for the snapshot dependencies (it was a mistake to use it I think), so that's why I'm looking into using Maven libraries.  FYI I disabled all Ivy detection for the Maven library experiment.

 

So is it possible to use Maven libraries and expect to be able to pick up newer versions? That is, expect it to behave like Maven?

 

Thanks,

IDEA 14.0.2 hangs?

$
0
0

Anyone else having this problem?  Since I upgraded to 14.0.2 Ultimate, it randomly hangs and becomes completely unresponsive.   Usually it's after I click the Windows "X" to close the app or after I attempt to switch projects.   Running in Windows 7 64 bit.  

 

I'm running on Java 7.0:

 

java version "1.7.0_55"

Java(TM) SE Runtime Environment (build 1.7.0_55-b13)

Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

 

And I'm attaching a thread dump.  


Tips on creating complicated live templates with groovy?

$
0
0

My team recently decided to explore switching to IntelliJ. Things are going pretty well, but someone discovered Live Templates and all of the complicated stuff they can do. Someone jokingly challenged me to write a live template which would spit out Preconditions checks for methods... A couple of days later I had figured this much out:

 

Abbreviation:

precon

Template Text:

$GROOVY$

Variables:

GROOVY - groovyScript("_1.collect { 'Preconditions.checkNotNull(' + it + ', \"'+ it +' cannot be null\");' }.join('\\n')",methodParameters())

 

This is pretty cool, and the output looks something like this:

            Preconditions.checkNotNull(id, "id cannot be null");
            Preconditions.checkNotNull(sourceKey, "sourceKey cannot be null");
            Preconditions.checkNotNull(partitionId, "partitionId cannot be null");
            Preconditions.checkNotNull(loadId, "loadId cannot be null");


Now, that's a good start, but definitely isn't perfect. This is fine if all of these variables are POJOs or other types which should only not be null, and are fine otherwise. However, we normally use other tools to help give us better control over input parameters and more informative output when things go wrong. Here's a better example of what the generated code above should look like:

            Preconditions.checkArgument(StringUtils.isEmpty(id), "id cannot be empty null");
            Preconditions.checkNotNull(sourceKey, "sourceKey cannot be null");
            Preconditions.checkArgument(StringUtils.isEmpty(partitionId), "partitionId cannot be empty or null");
            Preconditions.checkNotNull(loadId, "loadId cannot be null");

 

So, my main/core question is, how can I get both the method parameters and their type injected into my Groovy script, so that I can do conditional checks and generate preconditions checks accordingly?

 

But, more generally... Is there a better way to code these groovy script and smart template combos? There were a lot of hiccups while I was putting the above script together and instead of any really usable output/feedback/information, IntelliJ would just dump the errors/exceptions out into my source code after I had triggered the abbreviation.

How to have Collapsable/Expandable in intellij form.

$
0
0

Hi,

 

I am currently working on the plugin that is having the GUI form where i need the have the Collapsable/Expandable panel.It would be great if someone suggest me the good link i can refer.

 

I need to get the output in GUI form as attached.

Unit testing in gradle-based project

$
0
0

Hi all

Recently I started using libGDX library and gradle.

I have problem with unit tests (using JUnit4).

I created one simple test for one simple class. Both classes in the same module and the same package. Both in separate source trees src/* and test/*

I created Junit run configuration with classpath of this module and with my only test class as "Class".

When I'm trying to run it I get "Class not found" and this message refers to my test class selected as "Class" in run configuration!

 

On the other hand:

When started from gradle tool window I have log messages as follow in the right side of the Run window:

 

Testing started at 23:54 ...
23:54:20: Executing external tasks 'cleanTest test'...
Configuration on demand is an incubating feature.
:libgdx_dependent:cleanTest UP-TO-DATE
:libgdx_dependent:compileJava UP-TO-DATE
:libgdx_dependent:processResources UP-TO-DATE
:libgdx_dependent:classes UP-TO-DATE
:libgdx_dependent:compileTestJava UP-TO-DATE
:libgdx_dependent:processTestResources UP-TO-DATE
:libgdx_dependent:testClasses UP-TO-DATE
:libgdx_dependent:test
:libgdx_dependent:test UP-TO-DATE
BUILD SUCCESSFUL
Total time: 0.852 secs
23:54:21: External tasks execution finished 'cleanTest test'.

 

And on the left side:

 

Test events were not received

 

 

 

I have no idea what is going on.

Can anyone help?

intellij idea 14 color preview in xml editor

$
0
0

I updated IntelliJ Idea from 13 to 14 and I noticed that in XML file editor the little square representing a color preview (you can find it on the left near line number) has disappeared. I't still available on the xml editor while editing Layout files in android, but it's not available anymore on the normal xml editor. Can I turn it on somehow?

Launching from Ubuntu?

$
0
0

I found a pretty good web page that explained how to create an icon on the launch bar to launch IntelliJ IDEA.

 

http://nufailm.blogspot.ca/2012/05/custom-launcher-for-intellij-idea-in.html

 

However when I launch it I notice that it just hangs.

I think it's because it's trying to write to stdout or the console and can't, being as it was expecting to launch from a shell.

 

If I make a launcher out of the .sh file then I get a terminal window and the IDE ...

The terminal window seems sort of redundant.  How can I get rid of it?

Intellij 14

$
0
0

Hello

I am running into the following problem after upgrading to intellij 14 and updating the scala plugin to version 1.2.1 whilst running the project as a play app

 

[error] Not a valid project ID: xxxx

[error] project xxxx

[error]                 ^

The problem seems to be an included project in the build.sbt.  I am getting an error on lazy val loading in the build.sbt.  Has anyone encountered this problem? If I run an sbt package from the console everything works fine.  I recently migrated from intellij 13 to 14.  The project was working fine in 13.
Thanks

Google App Engine facet uses absolute paths

$
0
0

Hello,

We are building a Google App Engine application in Python, so we added the GAE facet. The configuration of the facet requires the SDK directory. This directory is stored as an absolute path in the .iml file.

<component name="FacetManager">
  <facet type="google-appengine-python" name="Google App Engine (Python)">
    <configuration>
      <option name="rootFolder" value="ABSOLUTE_PATH" />
      <option name="sdkFolder" value="ABSOLUTE_PATH" />
      <option name="templatesFolder" value="" />
      <option name="oauth2" value="true" />
    </configuration>
  </facet>
</component>

 

Not all people on the team don't install at the same place and we have folks on Windows, Mac and Linux. We have tried to create Path Variables in IntelliJ without success. This is almost as showstopper as it makes it very hard to put the .iml in source-control. We are using IntelliJ Ultimate 14.

 

Is there any known workaround?

Thanks,

 

gabriel


IntelliJ with PHP, Python, and ObjectiveC plugin vs PHPStorm, PyCharm and AppCode

$
0
0

Given the productivity gains we've had with AppCode over XCode, we're considering moving away from Vim / Sublime Text 3 (ST) for PHP and Python code, currently assessing PHPStorm and PyCharm as potential IDE candidates.

 

I noticed that IntelliJ comes with PHP and Python plugins.  I presume that the core functionality like code completion, syntax checking, etc across JetBrains IDEs are the same, could we:

1) Buy IntelliJ licenses with PHP and Python plugins, instead of buying separate PHPStorm and PyCharm licenses?

 

2) Are there any functional differences between using PHPStorm, PyCharm (and stand alone JB IDEs) vs. using IntelliJ with plugins?

 

3) Does a plugin exist for ObjectiveC / Swift in IntelliJ that could replace AppCode for us?

 

NB: We do not do Java development, so the only incentive to purcahse IntelliJ is to use it as the IDE base for PHP, Python code (and potentially ObjectiveC / Swift if that's supported).

 

Thanks a bunch.  Great work on the IDEs by the way.  We're noticing massive productivity gains & general developer happiness

 

regards

Johnathan

IntelliJ 14 - Including 1-year subscription starting v.13 - why 13?

Broken link - 'Discussion Forum' from IntelliJ IDEA Community page

Compiling Flex Modules

$
0
0

Hello

 

I am developing a Flex web application (IDEA 13) and my application displays some complex fxg artwork. The User makes a radioButton choice on startup and the appropriate fxg files are displayed.

 

To make the application more efficient I have created Modules in the following way:

 

  1. I created a new package named 'artwork' and placed all of the fxg files within.
  2. I created a new package named 'modules' and created a Module for each fxg file, example below.
  3. Within the Module Settings > Build Configuration I added the Modules to the list of Runtime-Loaded Modules and checked the Optimize checkBox.
  4. Compiled the application and all of the swf files were created as expected.
  5. Added ModuleLoader components to pull in the swf files when required.

 

What concerns me is that when built the application swf file is no smaller! Its as if because the fxg files and Modules are still within the src folder they are being compiled into the application still.

 

I have also created a new Project, copied the fxg files into a package there, created the Modules and can build the swf files from here as well (I created a link-report in the master application and used this when building the Modules).

 

It is much easier to have everything together in the main application, can anyone please explain where I am going wrong.

 

Thanks

 

Chris

Does querydsl work with IntelliJ?

$
0
0

Hello,

 

I have querydsl working with an Eclipse project. I imported the Eclipse project into IntelliJ. Under settings, I configured annotation processor options, similar to Eclipse properties.

But, I need to find any necessary querydsl plugins.

Has anyone gotten querydsl to work with IntelliJ?  I have not found any docs so far explaining how to configure IntelliJ to work with querydsl.

Any advice on this is appreciated!

 

Stratman2

Viewing all 5481 articles
Browse latest View live