Quantcast
Viewing all 5661 articles
Browse latest View live

Nashorn breakpoints

I was trying out some of the new features in IDEA 13.1.1 (Build #IC-135,480 March 21, 2014) and can't debug a simple nashorn example.

 

Java code (NashornDemo.java):

 

<code>

package demo;

 

import javax.script.ScriptEngine;

import javax.script.ScriptEngineManager;

import javax.script.ScriptException;

import java.io.FileNotFoundException;

import java.io.FileReader;

 

public class NashornDemo {

    public static void main(String[] args) throws ScriptException, FileNotFoundException {

        ScriptEngineManager manager = new ScriptEngineManager();

        ScriptEngine engine = manager.getEngineByName("nashorn");

        engine.eval(new FileReader("src/demo/hello.js"));

    }

}

</code>
JS code (hello.js):
<code>
print("Hello World!");
</code>
I can set a breakpoint in the java file properly, but the IDEA editor won't let me set a breakpoint in the JS file. Is there something I have to do or some sort of run option needed to do this. I was trying to follow this blog:
http://blog.jetbrains.com/idea/2014/03/debugger-for-jdk8s-nashorn-javascript-in-intellij-idea-13-1/
Thanks!

Structural Search Inspection not working for Structural Search that does?

Hello, All -

 

If I issue this Structural Search:

$field$ = $something$;if ($field$ == null) {     thrownew ServletException($msg$);}

with all default constraints via Edit > Find > Search Structurally, it matches code you'd expect it to, e.g.,

metricId = inputForm.getMetricId();if (metricId == null) {     thrownew ServletException("Missing metricId");}

 

If you dump this into a Structural Search Inspection as a Search Template, it doesn't flag this same code. (All of my other SS Inspections work great - I love this feature!)  Ideas?

 

Thanks in advance,

- Luke

How to use a external jar in a Java application

I'm trying to set up IntelliJ IDEA (13 and 12, on Mac) to use a Java class included a jar file for my Java application. 

 

The two jars are downloaded from http://introcs.cs.princeton.edu/java/stdlib/stdlib.jar and http://algs4.cs.princeton.edu/code/algs4.jar .

 

I've set the jar as a module dependency by the following procedure

 

* Start from the "project window";

* Select my main Java module;

* Use menu File | Project Structure;

* In Project Settings, select Modules, and select my Java application as interested module in the middle window;

* On the window to the right, select "Dependencies" tab, and press "+" and select "Jars or directories" and navigate to the jar file, add select it so the custom jar file is added as a new entry in the window, check the Export checkbox and set Scope pulldown set as "Compile";

* Press OK.

 

However, after setting this, in a Java class file in my Java application, if I use a class defined in the custom jar file, it still prompts me "Cannot resolve symbol 'SomeClass'".

 

Any idea what I'm doing wrong and how to fix this?

 

my settings:

 

Image may be NSFW.
Clik here to view.
Screenshot 2014-03-27 00.09.10.png

 

Image may be NSFW.
Clik here to view.
Screenshot 2014-03-27 00.08.10.png

 

 

The Libraries and Global libraries are both empty currently.  I did try to set the two jars there (separately) and add them as dependencies for the Java app, and it did NOT work, so I deleted them from Libraries and Global libraries. The above setting is using add module dependency as files directly (without first registering them as libraries), which still does not work.

 

Please help!  I'm desperate.  Have spent many many hours on this.

IDEA 13.1: Wrong cursor position after moving cursor to an empty line

ClassDefNotFound for tomcat app with META-INF/context.xml

Have run into an issue where I was getting lots of ClassDefNotFound classloader problems, but only when loading the app via IDEA launcher. If I drop the .war into tomcat and start it the application runs without issue. Also the classes it was saying where not present, where in WEB-INF/lib and the same .war functions (tried resetting my local maven cache anyway - which didn't help).

 

Turns it this webapp had a META-INF/context.xml file with a loader defintion in it:

 

<?xml version="1.0" encoding="UTF-8"?><Context>    <!--    This setting is for atmosphere, Comet functionality of navigator    to be able to run under Tomcat        <Loader className="org.atmosphere.util.AtmosphereClassloader"/>    -->   <Loader delegate="true"/></Context>

 

 

The Loader delegate="true" seems to be causing all the classloader problems when launching inside an embedded tomcat container? is that right? (tomcat 7.0.39 under centos 6.5).

 

Not sure why this is required here, app seems to have had atmosphere support at some point, I'm not sure if this loader/context is required for this app or not, but IDEA doesn't like it.

Not able to Deploy Grail war in tomcat in Intellij 12

I am not able to deploy Grail war in tomcat in IDE intellij 12 or in Spring suit. Can anybody guide me?  I do not want to deploy Grail war as external resource in intellij. Grail war should be deploy as artifact in intellij

Any help is appreciated?

Error marking not showing under modules on Project window

If I have the following project layout:

 

Project

--- moduleA

------ sourceFile1

------ sourceFile2

--- moduleB

--- moduleC

 

If sourceFile1 had an error, I don't see the redline marking a problem with moduleA; instead, I see a marking at the Project level, and if I expand the moduleA to see the files I can see that souceFile1 has the marking as well. But why moduleA doesn't have such marking? It would be nice to see which module contains the error without the need to expand trees to see where the error is occuring. Can this be done in intellij?

XSL files not recognized as source code?

Hi all, I'm using IntelliJ 13.1.1 version and I'm trying to import a module to a project that has this structure:

 

module

  - some files

  |- src

       |- Java packages

 

  |-xsl

       |- XSL files

 

Well, when IntelliJ is importing the source code, it only recognizes the 'src' directory, so I can't see the 'xsl' directory

within the IDE because .xsl files are not recognized as source code files. I have already enabled XPath + XSLT plugin...

 

How could I import that directory into the project?


Attribute type checking on field with @Converter

I've created custom type for entity field and made a @Converter for it, But Idea 13.1 claims about 'Attribute type checking'

Image may be NSFW.
Clik here to view.
attribute-type-check-with-converter.png

I created a test project on github.

Is it my fault or Idea does not support this feature of JPA 2.1?

 

13.1.1 IntelliJ IDEA 13.1.1

Build #IU-135.480, built on March 21, 2014

JRE : 1.7.0_51-b13 amd64

VM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

YUI Official Support [javascript]

I've tried to use the officially supported YUI library, but all that appears to do is install the YUI seed file with none of the modules.  Is there something else I have to do to get working YUI support?

Using Apple iOS, Mac UIAutomation

Is there a way enable code completion for javascript that is written for Apple's UIAutomation JavaScript library? And is there a way to debug the UIAutomation JS Scripts using intellij (or AppCode)?

 

Thanks!

Cannot add form to another - IntelliJ 13.1

Hello everyone,

 

When I try to add a newly created form in the UI Designer to another form, I always get this message: "Forms added to palette must have a binding for the top-level component". If I add an older form it works.

 

Way to reproduce: Make two forms, add a component, add one form to the other.

 

Does this happen to others too, or is something amiss here?

 

Cheers,

Ulrik

editor does not find library containing @NotNull annotation

I created a simple test project that uses @NotNull. I added a dependency on a library that defines it (a copy of the IDEA annotations.jar but with a different name). I added an import statement:

 

import org.jetbrains.annotations.NotNull;

The program builds without error. However, the editor fails to find the library. It highlights "jetbrains" in red and says it can't resolve the symbol. Same for @NotNull.
I have observed this problem in IDEA CE 13.1.1, 13.0.2, and 12.1.
Oddly, the problem does not occur in 11.1.2.
Am I missing something, or is this a regression that has not been observed?

Java Web Start JNLP debugging

Is there some way to run the trace/debugger on a Java Web Start JNLP

app?

--

Roedy Green Canadian Mind Products http://mindprod.com

"A great lathe operator commands several times the wage of an average lathe

operator, but a great writer of software code is worth 10,000 times the

price of an average software writer."

~ Bill Gates

 

Building IntelliJ project with CI Server

Hi,

We are using IntelliJ to develop Adobe AIR application.

I want to add it to our CI server, what is the best way?

 

Is there a way to build and test the project without installing IntelliJ on the CI server?


Installing 13.1

I uninstalled 12.1.  I have JDK 1.7_51 both 32 and 64 bit installed.

 

I removed all files in F:\Program Files (x86) and C:\users

 

I pruned IntelliJ entries from the registry.

 

When I install 13.1 I get "Failed to install JVM, error code -1"

 

Some time ago I had trouble installing 13 over 12.1.  Someone from

Intellij gave some hints on what to do.  I did not get around to it

until the instructions scrolled off my reader.

--

Roedy Green Canadian Mind Products http://mindprod.com

"Incorrect documentation is often worse than no documentation."

~ Bertrand Meyer (born: 1950 age: 63), creator of design by contract

and the Eiffel language.

 

Why do opened files in other splitted sections was removed from 'recent files' list?

Now it kinda confused when you edit file, and you remember it, but can't find it in recent files list.

So you find files through 'cmd+shift+n' and gets needed file already opened in another split section.

 

Well, I'm remember last files, but I don't remember which files opened now, and I do not rechecking it every minute, because it already  easier to open needed file through the 'recent files' or 'last edited files' lists.

I agree, that the signal point before file name in 'recent files' list is not really noticable and should be more brighter or made as filename background.

 

Btw, please, return opened files to 'recent files' list.

Run Android app with the System signature key

Hi all,

 

I recently switched mobile phone operator and the new operator has taken on my old number. However, the number stored in the SIM, which is visible to Android, is incorrect (it is the number that was given to me before the switch over).

 

Somebody wrote a little app a few years ago that allows changing the number on the SIM:

 

https://github.com/fommil/MyPhoneNumber/blob/master/src/org/lytsing/myphonenumber/MyPhoneNumber.java

 

I have no idea how the original author ever got it to compile, I've needed to use reflection much as others have discovered:

 

http://stackoverflow.com/questions/9369648

 

but there is an additional problem: apparently this must be run by an app signed with the "system signature key":

 

http://stackoverflow.com/a/6029410/1041691

 

Now, this is the closest documentation I can find for signing an application in IntelliJ:

 

https://www.jetbrains.com/idea/webhelp/generating-a-signed-apk-using-a-wizard.html

but the instructions appear to be much more complicated than this for Eclipse:

http://stackoverflow.com/a/3651653/1041691

 

 

So how do I run an app on my phone (which is physically connected by USB), signed with the system signature key, in IntelliJ? (e.g. how do I obtain the system key in the form of a keystore, should it be that simple)

IntelliJ Python Flask: not allowing new line, comma, and opening paranethsis

I don't know what happened, but now there are certain places where intellij won't allow me to use the enter key (new line), add a comma, or make an opening paranethsis.  I am doing the Stripe tutorial, but I verified this in a Flask project I had done before.  I'm not sure if this has to do with the new update to 13.1. 

 

In a line that contains "app = Flask(__name__)" it won't allow me to use the enter key. 

 

In a line that contains "@app.route" it won't let me type an opening paranethsis to complete the URL routing [e.g. @app.route('/') ]

 

It doesn't allow commas in most methods includeing the above @app.route and even in a normal line like this:

 

customer = stripe.Customer.create(email='customer@example.com', card=request.form['stripeToken'])

-It doesn't allow the comma between parameters in the function

-It doesn't allow pressing the enter key to put the parametes on a new line for formating the line. 

 

 

Anyone else having these same problems? I know this wasn't happening before in previous flask projects prior to upgrading. 

Fix for 13.1: AngularJS plugin not working (possibly other plugins, too)

TLDR: If AngularJS isn't working, invalidate the caches (File -> "Invalidate Caches / Restart") to force everything to be reloaded.

 

In case any one else is having this issue:

 

I just installed IDEA 13.1 overtop my 13.0 installation.  When I restarted, I couldn't get AngularJS to work at all.  There were no suggestions, ng-* attributes were marked invalid, etc.  I was about to pull my hair out, because it was working in a different project, which was a fork of this one.

 

Anyway, the main difference I could see was that one had a space in the name, and the other didn't.  I decided to rename the folder and see if that helped, which, magically it did.  I renamed it back, to see if it was an issue with the plugin, but everything was still working.

 

I'm taking a small guess here, but I think it basically invalidated all the cache data for the project, and forced it to reload.  If I'm right (and maybe someone can chime in here), then simply going to File, Invalidate Caches / Restart and invalidating the caches will probably fix your issue.

Viewing all 5661 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>