Unable to set up rhino debugger as a project in my IDE - ide

I am trying to tweak Rhino debugger work with my servlet so I downloaded the sources and for some reason I having some difficulties to set up the project properly in my IDE (intellij).
I have tried to add both the SRC and the Jar file but it seem like there is an .internal. package that get in the way.
For example:
Global that somewhere along the inheritance chain extends from sun.org.mozilla.javascript.internal.ScriptableObject
But who ever is using Global is expecting org.mozilla.javascript.ScriptableObject.
When I build the code using ant, it works fine so I am guessing it is something that I am missing..
Any ideas?

The issue was that IntelliJ was modifying the imports when loading the project.
and the imports got mixed up between the
org.mozilla.javascript...
and sun.org.mozilla.javascript.internal.ScriptableObject
Creating a new project with the whole downloaded zip fixed the problem and gave the right source the was loaded

Related

HelloWorld in Kotlin gives error "Could not find or load main class"

I spent the last 1,5 hour trying to make this simple tutorial work in IntelliJ IDEA, as you can see in this video.
When trying to run the code, I get the error:
/[...] -Dfile.encoding=UTF-8 src.HelloKt
Error: Could not find or load main class src.HelloKt
Caused by: java.lang.ClassNotFoundException: src.HelloKt
I have tried setting up SDK, invalidating cache, removing .idea and .gradle, rebuilding project, deleting the profile and adding it again. I tried those actions in different orders.
Here's a screenshot of the project:
It also complains Kotlin is not configured, but I have already configured it.
Here's the run configuration:
Here are the project settings:
Your Hello.kt file needs to be somewhere inside the src/main folder, probably in src/main/kotlin. This is different from the tutorial, because your project is using Gradle, and the one in the tutorial isn't. I think this is because newer versions of IntelliJ use Gradle by default for new projects, which wasn't the case when the tutorial was written.
The use of src/main/kotlin and src/test/kotlin as source code directories is a convention in Gradle (and Maven). When importing a Gradle project into IntelliJ, main becomes a module, and kotlin becomes a source folder within that module. The same goes for test. In your screenshots, the bold text and blue icons on main and test confirm that's how your project is set up. Files outside of those folders aren't treated as source files, which explains why your Hello.kt file isn't being compiled or recognised correctly.
It's likely that the default behaviour of IntelliJ when creating a new project has changed since this tutorial was written. In the tutorial, they select "Kotlin" as the project type and this creates a project that doesn't use Gradle. As a result, the project doesn't use the src/main/kotlin directory structure.
I can see from your video that you selected the same option, but on the next screen, IntelliJ still automatically selected Gradle as the build system for the new project. To match the project structure used in the tutorial, I think you would need to select "IntelliJ" as the build system.

Intellij can not locate some classes - Play SBT. Intellij bug?

I have a few import statements in my project that are displayed in RED. Intellij shows 'Cannot resolve symbol' errors, and I am not able to autocomplete these classes or their methods. However, when I run my project it runs perfectly fine. This is strange so much so, that lets say I have an import statement
import org.apache.velocity.app.Velocity
It cannot resolve the 'Velocity' class, even though when I do a ctrl+b selecting the 'app' package, it clearly shows the Velocity class:
I am lost in this and I am struggling to code like this. Any help will be appreciated.
Best Regards.
EDIT: In my project, some of the dependencies are also not resolved, although I refreshed my project multiple times. The exact same dependencies are resolved in my colleague's system, who is using the same code-branch and environment as me.
I can see that the unresolved dependencies lie inside the play.sbt package, but are still not resolved. Is there a compatibility issue between Intellij("15.0.2") and SBT("0.13.8" mentioned in build.properties of my app)?
Reimport project using option 'Import project from external model' and choose 'sbt'. In next window choose options like 'use auto-import' and download 'sources for SBT and plugins'.

Spring Boot default settings do not allow me to autogenerate a new class in IntelliJ

Just switched to the Intellij Ultimate 14.1.4 IDE. Tried to build a simple Spring Boot helloworld endpoint but ran into several problems.
I first created a new Spring initializer project with no issues. I went through the various windows setting up the project with no issues. When the project was created it did not generate a Spring Boot main application class, which is no big deal; it's just an irritation for a newbie.
I selected src > file > new and tried to select a Java class but found that there was none in the drop down box. Most of the drop downs were JavaScript, CSS, and JSON files. I guess I do not have the correct default for Spring Boot. Anybody know how to set this up?
The crux of the issue is that you were not running that command in the context of a source or test folder. If you attempt to do any autogenerate commands in a non-source folder, you won't get the full set of things that can be generated.
The simple fix is to be sure that you're in the right folder - likely src/main/java.
If the folder isn't marked blue, then right-click on it, and select Mark Directory As > Sources Root.
This is what it appears when you don't have the folder marked as source:
...and this is what it looks like when you do:

Extending Titanium WebViewProxy for Android - Build error

I need to extend Titanium's Android Webview with some additional functionality, however I'm not able to build my titanium project after including my created module.
My module has the titanium-ui.jar on it's build path and I have copied the original Titanium WebViewProxy.java into my module project. I haven't added any custom code to WebViewProxy.java yet.
This is the project hierarchy of my module, together with the build.properties file.
When building the module, I get an exception but the module seems to get built anyway, this must have something to do with the final problem. When I remove the WebViewProxy.java and keep the titanium-ui.jar on my build path, building the module and including it in my titanium project works fine.
Here's the full console log of the build script of the module: http://pastebin.com/G2LSkFLF
This is what happens when I try to run my titanium project using the generated module (the one, that threw the exception while building)
Does anyone know how to solve this? Maybe some different approach at all? I have some special url schemes in my app and I need to handle them. I have already a similar module for iOS, which works fine.
Thanks.
Ok, I finally found the solution. It was so easy... The WebViewProxy.java had to be adjusted a little bit.
#Kroll.proxy(creatableInModule=UIModule.class, propertyAccessors = {
has to be
#Kroll.proxy(creatableInModule=CustomwebviewModule.class, propertyAccessors = {
UIModule.class has to be replaced with the class name of your Module.

Create project from existing code issue

I'm trying to open an existing project into Idea Community Edition (it is a netbeans project). I tried using create project from existing code.
One of the modules ends with .Lib (something like MyApp.Lib). For some reason Idea doesn't import that module, and even if I try to create a project with just that module it doesn't let me (it doesn't even show up in the directory browser, even though that it is there if I check with windows explorer).
I'm guessing it has to do something with the Lib at the end, probably it considers it as a library folder. Does anyone happen to know a way around this?
Renaming the module is not an option, as it is under version control.
I found the solution to this. Needed to remove .lib from the Ignore files and folders in the Settings>File Types section.