IntelliJ Idea 11 Flex compilation issue - java

I have problem with completing my code. It works fine in Flash Builder. But I used it previously in Idea and it was much faster. So I imported my FB files into new Idea project. But when I try to debug I receive error message:
Using built-in compiler shell, up to 4 parallel threads
See compiler settings at File | Settings | Compiler | Flex Compiler page
Starting Flex compiler:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -d32 -Dapplication.home=/Applications/Adobe/flex_sdk_4 -Xmx384m -Dsun.io.useCanonCaches=false -Djava.awt.headless=true -Duser.language=en -Duser.region=en -Xmx512m -classpath "/Applications/IntelliJ IDEA 11.app/plugins/flex/lib/idea-flex-compiler-fix.jar:/Applications/IntelliJ IDEA 11.app/plugins/flex/lib/flex-compiler.jar:/Applications/Adobe/flex_sdk_4/lib/flex-compiler-oem.jar" com.intellij.flex.compiler.FlexCompiler 58789
Compilation completed with 1 error and 0 warnings
java.net.SocketTimeoutException: Accept timed out
I tried to restart my computer. I have clean OS installation and I don't have any program that should block it.
If it helps I develop on OS X 10.7
Thanks for your replies.

Just did a fresh install of IDEA 11.1.3 and Flex SDK 4.6 and got this error with a brand-new Flash Mobile app+module.
Here's how I fixed it:
Go to Settings > Compiler > Flex Compiler
Choose Mxmlc/compx instead of the default Built-in compiler shell
(Screenshot: http://puu.sh/10Nhg)
Compile your application

The accepted answer above did not work for me, and while the answer provided by Florian Salihovic pointed me in the right direction, I thought I would post the solution here.
This comment on the link provided by Florian Salihovic, specifically the comment I've linked to directly, contains the following solution that worked for me:
Find your hostname. You can use hostname in your shell.
Edit /etc/hosts and add 127.0.0.1 <<hostname>> where <<hostname>> is the name reported by the hostname command.
I have found that this corrected my issue (on Linux) and should correct the issue on OSX as well. With this, you can use the built-in compiler shell still as well.

This is similar to an issue tracked on Jetbrain's YouTrack Error while starting Flex compiler. You might could check that one.

Related

JAVA : Program Works in Terminal , But not in Visual Studio Code : Mac OS

My JAVA Programs used to run without any errors on both the Terminal and Visual Studio Code's Terminal .
After my Mac updated to MacOs Big Sur Version 11.0.1 , my JAVA programs show an error , even though the same code worked properly before .
There was no error before.
I checked my JDK and JRE Installations also
My Python files execute normally in the VS Code environment , so I do not think there is a problem with VS Code .
I have tried searching for an solution and have tried to clear the logs.
I would appreciate if anyone could guide me :)
Run the .java file in Terminal to check if JDK can work normally:
javac Hey.java
java Hey
If there's nothing wrong with the above command execution, turn to VS Code, uninstall Java Extension Pack and also delete the related folders under User/name/.vscode/extensions, then reinstall it again;
Set java.home and java.configuration.runtimes in User Settings.json.
Reference: Configure JDK.
Then run the project again to see if the problem goes away.
Install Java by searching for extensions in VSCode and try to run again.It will be executed. I belive it is not installed
You need to install the java plugin in VS Code.
Hi just found a solution here!
Initially guess it should be a problem with zsh.
so first open your terminal and type
open ~/.zshrc
at this point you will see text editor pops up with a zsh config file.
Add
export JAVA_HOME=`/usr/libexec/java_home
to the last line in that file, and save the file quit.
Then just reopen the VSC and you will notice everything would back to normal as usual.
I faced a similar problem. When running the same Java program, it worked in terminal but VS Code couldn't detect java.
All it turned out to be was I forgot to add Code itself to Path after reinstallation, nothing to do with Java.

Update to IntelliJ 2017.1 causes JAVA_TOOL_OPTIONS to print

This morning I updated to IntelliJ IDEA 2017.1, when I run any of my tests, and even run a hello_world project I made, the console prints a message stating Picked up JAVA_TOOL_OPTIONS: -agentpath:"C:\windows\FireEye\JavaAgentDll_00.dll" after executing my program.
Also, when I try to run in debug mode I receive the error:
ERROR: JDWP unable to get necessary JVMTI capabilities.
If I run the program outside of IntelliJ I do not receive these errors. Is there a solution to resolving the error and is there a reason the JAVA_TOOL_OPTIONS is now "picked up"?
Remove this environment variable from the system or configure the run/debug configuration to not include parent environment:
I solved this problem by adding the following command into idea.bat file:
UNSET JAVA_TOOL_OPTIONS
I'm running IntelliJ 2017.1 on Windows 7, and my idea.bat file is located at C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\bin folder.
The top 5 lines of my idea.bat file looks like these after the changes:
#ECHO OFF
UNSET JAVA_TOOL_OPTIONS
::----------------------------------------------------------------------
:: IntelliJ IDEA startup script.
::----------------------------------------------------------------------
I've had the same problem at work. This is probably FireEye knowledge rather than an IntelliJ answer, but I find that when I run IntelliJ as administrator the problem goes away without any settings changes, so this works if you have admin access to the development box.
Note that if you start IntelliJ from the IDEA toolbox then the toolbox also needs to be run as adminstrator.
Another way to override the env is from the from the Help | Edit Custom VM Options menu of all places.

Run SBT in debug mode. "libjdwp:transport.so: cannot open shared object file: No such file or directory" [duplicate]

After update from 0.13.6 to 0.13.7 I cannot debug with SBT.
It is installed using Homebrew. I tried to reinstall it, brew doctor shows nothing.
I did not change/reinstall Java between SBT update.
lgr$ sbt -v -jvm-debug 5005 "project webapp" run
[process_args] java_version = '1.8.0_25'
# Executing command line:
java
-Xms1024m
-Xmx1024m
-XX:ReservedCodeCacheSize=128m
-XX:MaxMetaspaceSize=256m
-agentlib:jdwp:transport=dt_socket,server=y,suspend=n,address=5005
-jar
/usr/local/Cellar/sbt/0.13.7/libexec/sbt-launch.jar
"project webapp"
run
Error occurred during initialization of VM
Could not find agent library jdwp:transport on the library path, with error: dlopen(libjdwp:transport.dylib, 1): image not found
I am unsure whether SBT is missing some library, or brew formula didn't install properly.
I will be helpful for any idea how to fix it.
Reinstalled Java, didn't help.
Workaround I downloaded SBT 0.13.6 and it works without problem, so I start to consider this as a sbt bug. Can anyone help to clarify if it is?
To piggyback on Eugene's answer above, since the fix is in a bash script, it is pretty easy to apply the fix from https://github.com/sbt/sbt-launcher-package/pull/85/files manually. Just edit bin/sbt-launch-lib.bash to have this:
addJava "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$1"
Instead of this:
addJava "-agentlib:jdwp:transport=dt_socket,server=y,suspend=n,address=$1"
(Mind the : not = between jdwp and transport).
It is installed using Homebrew.
Homebrew install is sanctioned by sbt project as a recommended way to install on Mac, but we (I'm one of the sbt devs) currently don't control it. We do however have the official package sbt/sbt-launcher-package, and last I checked Homebrew is also using it.
Looking at git blame of the relevant part of the script, it seems like the debug option was "fixed" in sbt/sbt-launcher-package#83:
In sbt-launch-lib.bash, -Xdebug option is used for debugging. We should use -agentlib option for Java 5+.
Maybe your issue should be tracked as a bug in sbt/sbt-launcher-package.
The problem was fixed in the 0.13.8 version.
At my case the bash fix didn't help but running from bash as:
export SBT_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
sbt
helped. It is from here.

Error while loading class when using Stanford Topic Modeling Toolkit (TMT)

I have tried JDK7-Update40 and JDK8, but still cannot run the test codes from the TMT website.
Everytime I click 'run', it give error messages as below:
error: error while loading CharSequence, class file 'C:\Program
Files\Java\jre8\lib\rt.jar(java/lang/CharSequence.class)' is broken
(bad constant pool tag 15 at byte 1470)
And I using the wrong JDK? What specific version should I use?
Can anyone help me out?
Many thanks!
I also had the same problem.
The way I see it, sbt does not support java8.
Let me describe you my work around.
There are several jdk's installed on my machine.
So I've opened the command line, set JAVA_HOME variable
to 'C:\Program Files\Java\jdk1.7.0_55',
simply typing
SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55
and had another go with sbt command. That worked for me.
Hope, that will help.

Scala REPL only runs as root user, gives error when run as non-root

I'm running 64-bit OpenSUSE 12.1, today I downloaded the latest Scala 2.9.2 from the official website, after unpacking the tgz and go to scala-2.9.2/bin directory, I executed "scala" and got this error message:
[init] error: error while loading <root>, error in opening zip file
Failed to initialize compiler: object scala not found.
** Note that as of 2.8 scala does not assume use of the java classpath.
** For the old behavior pass -usejavacp to scala, or if using a Settings
** object programatically, settings.usejavacp.value = true.
I attempted to run scala -usejavacp but it doesn't help.
I've been using Scala a lot in many other distros and have never got this error before.
My OpenSUSE installation has OpenJDK 6 installed.
Please suggest your opinions, thank you!
I have made the following attempts to solve the problem:
Install Oracle JDK 1.7 and run scala, confirmed that scala REPL reports running in hotspot JVM 1.7, same error occurs.
Installed sbt and run "console" from sbt, same error occurs.
strace and diff the output between sudo scala and scala as normal user, there is no difference except the error message above.
scala -Ylog-classpath as su and normal user, then diff the output, same as above.
disabled AppArmor and tried again, same error message.
Download other scala versions (all of 2.9x, and 2.10 milestone 4), all of their REPL give the same error message.
Made sure fsc is not running before scala REPL runs
Made sure that the hostname is resolvable
well this is a really interesting problem, I'll definitely post a solution if I can luckily find it.
Thanks a lot for your help!
Last edit:
Thanks for everyone here and on reddit (http://www.reddit.com/r/scala/comments/w5s0m/please_help_scala_only_runs_as_root_user_gives/) who offered very valuable suggestions to help me figure out this very strange issue. See my answer below for the solution.
Do not put sbt-launch.jar in your $SCALA_HOME/lib directory, your project's lib directory, or anywhere it will be put on a classpath.
I have just found out the reason:
A closer examination of the output of "strace -f scala" as normal user yields an interesting output:
[pid 11919] open("/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/ext/gnome-java-bridge.jar", O_RDONLY) = -1 EACCES (Permission denied)
Soon follow that, is the system call to inform user that scala REPL failed to initialize:
[pid 11919] write(1, "\nFailed to initialize compiler: "..., 260
The gnome-java-bridge.jar has permission 400, I changed it to 444 and problem is solved!
The permission issue seems to have been listed as OpenSUSE bug:
http://lists.opensuse.org/opensuse-bugs/2012-07/msg00920.html
It looks like it's not being able to open `scala-library.jarĀ“, or one of the other jar files required for REPL.
You did not say whether scalac works or not. That might give a clue.
At any rate, I'd make sure all of the jar files are a+r, and the directory they are in, as well as all other parent directories, are a+rx.
This is most probably caused by jdk-xxx/jre/lib/ext containing jars that is not readable. Please look for file starting with "."jar and "._jar" and remove them.

Categories