integrating aj with idea.bat

Dmitry J said: The easiest way to run IntelliJ IDEA under the AspectJ runtime is to edit idea.bat (or idea.sh) and replace java with aj (in idea.bat this is the line thar sets the JAVA_EXE variable, in idea.sh this is the $JDK/bin/java invocation at the very end of the script).

Without asking around to anyone or expending any time on it, just off the top fo your head, do you know of anyone who's done this successfully- just plugged in aj.bat instead of java.exe into that file in that place and had it work?
Been trying for a a day or so  now and can't get it going.


from YOUR_INTELLIJ_SOURCE_LOCATION\bin\win\idea.bat

[SNIP]

:: SET JAVA_EXE=%JDK%\jre\bin\java.exe <-- commented out
SET JAVA_EXE=C:\aspectj1.6\bin\aj.bat   <--- replacement line

[/SNIP]

Just a yes or no is good enough

8 comments
Comment actions Permalink

Regarding idea.bat and aj.bat, it's hard to see how altering any line in idea.bat could cause aj.bat to have any effect when the built Community is launched since it appears that idea.bat in the built Community distribution is never called or referred to in any way.

At least, renaming it to ideaSchmea.bat didn't stop the built Community from launching, and neither did changing any line within it have any effect.

So you can see my confusion here.

Along these same lines it seems like idea.bat is just never called even in the launching of the shipped version of Intellij. Removing it, renaming it, changing lines in it has exactly zero effect on launching and running intellij.

Am I missing something here?

0
Comment actions Permalink

Running IntelliJ IDEA from within IntelliJ IDEA doesn't use any batch file; it runs java with the specified class directly. idea.bat needs to be run from the command line.

0
Comment actions Permalink

I confess to not being a batch file whiz although I am working to rectify that hourly right about now.

From where should one invoke the batch file?

Not by clicking the icon in the directory that it's located in because the path which results  (apparently specified in the batch file) turns out to be wrong: javalang.ClassNotFoundException com.intellij.idea.Main  

When you invoke idea.bat from the directory  YOUR_SOURCE_INSTALLATION\out\production\bootstrap  which is the containing  parent of  com.intellij.idea.Main and if you were invoking java is where you'd need to invoke it from to find Main,  you get the same error :)  

Invoking java (and not idea.bat) from this same position does indeed find com.intellij.idea.Main (which then of course proptly blows up since idea.bat hasn't been run to set the needed classpath correctly) ...


Perhaps there's a tutorial I missed.  I couldn't find any mention of idea.bat at all on jetbrains website using the built in search facilities on the site nor anything useful through Google, restricting the search to jetbrains and otherwise.

0
Comment actions Permalink

idea.bat is invoked from the 'bin' directory of a complete distribution (where the 'lib' directory contains the .jar files). Running Ant from the command line puts archives of the complete distributions for each operating system inside the out/artifacts directory.

0
Comment actions Permalink

OK numbered for easy yes/no answers :
1) I have to package up the output of the Community build into a jar .
2) I do this by using some ANT script somewhere.
3) When I have done that, the classes which are now in the "out/production" folder willl have been placed into a .jar file inside the lib directory.
4) This is a direct consequence of running some ANT file somewhere
5) which I am going to guess without checking is called "build" and appears somewhere obvious in the downloaded Commmunity  source.

6) Now that the .jar file exists adn is located in the lib directory, invoking idea.bat from the "bin" directory will cause the built Community to launch.

7) Within idea.bat, replacing  the existing line



SET JAVA_EXE=%JDK%\jre\bin\java.exe <-- commented out


with

SET JAVA_EXE=C:\aspectj1.6\bin\aj.bat   <--- replacement line


should  result in aj completing successfully and launching the built version of IntellJ Community.


Ahhh if I can get through this I will contribute a "how to" to the Intellij site...

0
Comment actions Permalink



OK trying to run  IntellijSource_jan_21\build.xml from the Ant Build tool window by right clicking on all->run fails (with five errors - likely one propogated upwards through the processing  stack) "Java returning 1 ".

The thing is I have made  sure that I am sharing the classpath of community, as per your previous instrcutions to another poster.

Also, the build will succeed if I build it using build->rebuild and don't use the ANT Build window directly;

If I do a build->rebuild with Make, Run Ant target "all" , Build Artifacts all checked under Run->edit configurations- along with "use classpath of module : community-main", then it still succeeds and what's more appears to run ANT build also.
However, the result of that process is not a jar file anywhere in out. I just end up with the compiled class files as per the non-ANT build and some new folders in out: dist.xxx.ce  all of which are empty. I would ahve guessed that dist stands for "distributable jar lives here"  .


OK numbered for easy yes/no answers :
1) I have to package up the output of the Community build into a jar .
2) I do this by using some ANT script somewhere.
3) When I have done that, the classes which are now in the "out/production" folder willl have been placed into a .jar file inside the lib directory.  <-- apparently false
4) This is a direct consequence of running some ANT file somewhere  <-- apparently false
5) which I am going to guess without checking is called "build" and appears somewhere obvious in the downloaded Commmunity  source.

6) Now that the .jar file exists adn is located in the lib directory, invoking idea.bat from the "bin" directory will cause the built Community to launch.

7) Within idea.bat, replacing  the existing line



SET JAVA_EXE=%JDK%\jre\bin\java.exe <-- commented out


with

SET JAVA_EXE=C:\aspectj1.6\bin\aj.bat   <--- replacement line


should  result in aj completing successfully and launching the built version of IntellJ Community.


Ahhh if I can get through this I will contribute a "how to" to the Intellij site...


OK numbered for easy yes/no answers :
1) I have to package up the output of the Community build into a jar .
2) I do this by using some ANT script somewhere. uh
3) When I have done that, the classes which are now in the "out/production" folder willl have been placed into a .jar file inside the lib directory.   WRONG
4) This is a direct consequence of running some ANT file somewhere
5) which I am going to guess without checking is called "build" and appears somewhere obvious in the downloaded Commmunity  source.

6) Now that the .jar file exists adn is located in the lib directory, invoking idea.bat from the "bin" directory will cause the built Community to launch.

7) Within idea.bat, replacing  the existing line



SET JAVA_EXE=%JDK%\jre\bin\java.exe <-- commented out


with

SET JAVA_EXE=C:\aspectj1.6\bin\aj.bat   <--- replacement line


should  result in aj completing successfully and launching the built version of IntellJ Community.


Ahhh if I can get through this I will contribute a "how to" to the Intellij site...

0
Comment actions Permalink

FWIW the ANT build blows up at

build.xml:19: Java returned: 1

at org.apache.tools.ant.taskdefs.Java.execute(Java.java:111)



Waht I dont' understand is how the ANT build build.xml can blow up but the build-rebuild all goes off just fine; this proves that the classes themselves are not at fault and whatelse does ANT require but a set of compilable classes.
The build.xml goes on for quite a while doing well so I suspect it's the builsding of the jar or something else non-compilation dependent that's blowing up.

0
Comment actions Permalink

OK running ANT from the command line as detailed in How TO Build INtllij Community Build fails in exactly the same way with exactly the error message at exactly the same place line 19.



19      <java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true">


this particular error isn't symptomatic of any known issue, like groovy not being installed (puliing that out of  nowhere just now)  something like that, is it?

If not, how does thing kind of thing ever happen? How can a straight download onto the machine and invocation of ant on build.xml ever fail? This is the most frustrating kind of mystery. What's to do but download it yet again and hope it goes better next time. It's a thing which should just not occur. It's like it's at the axiomatic of  level of stuff to be done;   it just has to work without fussiness so other things can get done.

It's a little like playing roulette.. a very very very very very slow  game of roulette where each turn of the wheel takes half an hour :(

0

Please sign in to leave a comment.