Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iExpensive

macrumors 6502
Original poster
Oct 18, 2010
261
10
Las Vegas
I'm currently taking AP Computer Science II and we are using BlueJ for java programming. The program will run, then give me an error for no reason. I'm running Lion btw.

The error is "BlueJ was unable to create a virtual machine to execute projects"

They have info on this in there FAQ but it's for Linux

Linux) Error: "BlueJ was unable to create a virtual machine (VM) to execute projects..."

On Linux, this problem can be caused by Security Enhanced Linux ("SELinux") or overly restrictive firewall rules. Consult your distribution's documentation to find out to disable or correctly configure SELinux and/or the firewall. More information is available on our firewall information page.

If you are running Debian "Sid" (the "unstable" Debian release) and you get this error message, it may be because of an apparent incompatibility or bug with Java. Some users have been able to resolve this by editing the file "/etc/sysctl.d/bindv6only.conf" and changing the setting "net.ipv6.bindv6only" from 1 to 0, and restarting the computer. However, we recommend that you do not run the unstable Debian release (or any other "unstable" Linux distribution or operating system) if you are not able to resolve problems like these on your own.

Anyone have luck running this on a mac?
 
Last edited:
That is interesting. I am running lion also and have had no issues with BlueJ. Although I don't like the program I use it for my java class.

I would start by removing it from you system and try reinstalling it.
 
hmm...
Maybe I need the developer tools from apple? How do I get those if Lion was preinstalled?
 
Last edited:
@iExpensive

did you solve your bluej problem? I have the same one and interestingly it only startet after a fresh re-install of osx lion. Before everything was fine. Xcode Dev tools are installed and java works fine besides this. Also BlueJ is enlisted in my firewall settings and connections are allowed...

can anyone help?
 
I'm currently taking AP Computer Science II and we are using BlueJ for java programming. The program will run, then give me an error for no reason. I'm running Lion btw.

The error is "BlueJ was unable to create a virtual machine to execute projects"

They have info on this in there FAQ but it's for Linux



Anyone have luck running this on a mac?

Go check your Java preferences (Applications->Utilities->Java Preferences) If you have more than one release (I count 32 and 64 bit releases as one) of the runtime environment, try putting them in a different preferred order.

EDIT: BTW, any specific reason why you're forced to running BlueJ? If you could use something else, you could also try if the problem is BlueJ-specific.
 
@iExpensive

did you solve your bluej problem? I have the same one and interestingly it only startet after a fresh re-install of osx lion. Before everything was fine. Xcode Dev tools are installed and java works fine besides this. Also BlueJ is enlisted in my firewall settings and connections are allowed...

can anyone help?

It's probably not BlueJ that needs to be listed in your firewall settings. The "virtual machine" it runs is probably another process altogether. Try disabling the firewall entirely first to see if it resolves the issue. If it does, you know you just have to pinpoint the proper process to "authorize" and if it doesn't, you know your issue lies elsewhere.

EDIT: BTW, any specific reason why you're forced to running BlueJ? If you could use something else, you could also try if the problem is BlueJ-specific.

The OP is probably done with his semester by now. ;) (Check the thread date).
 
It's probably not BlueJ that needs to be listed in your firewall settings. The "virtual machine" it runs is probably another process altogether. Try disabling the firewall entirely first to see if it resolves the issue. If it does, you know you just have to pinpoint the proper process to "authorize" and if it doesn't, you know your issue lies elsewhere.

Hey thx for the quick response. In the meantime my problem solved itself... but do not ask how and why. I tried it a few hours later again, this time no Error Message. Didn't even log or restart, just put it too sleep and back on again.

I don't no if its just me, but i'm having a lot of these small issues with Lion especially with the firewall etc. Itunes e.g. always asked for permission to connect. Took me some time to solve this, too.

But anyway, thx a lot, and btw I need BlueJ for a college course. ;)

Cheers
 
Update

In the meantime i found out how to reproduce the Error-Message "BlueJ was unable to create a virtual machine to execute projects". Turns out that my internet connection / router is causing the issue. When i cut my connection it works perfectly without any error. When i am connected elsewhere ( in this case at my university) it also works normal. Just when i'm at home and connected (with a Vodafone Easybox 803) the error pops up.


in the bluej-debuglog.txt it says:


Code:
Listening for JDWP connection on address: localhost:50319
Extra output from debug VM on launch:FATAL ERROR in native method: 
JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

Error output from debug VM on launch:ERROR: transport error 202:
 connect failed: Connection refused
ERROR: JDWP: Failed to initialize transport via localhost:50319, 
trying localhost via 127.0.0.1:50319
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
 [../../../src/share/back/debugInit.c:690]


I'm guessing that the router is somehow blocking the connection via the locahost? Dut i'm not really an expert...

Does anyone have a clue?

EDIT: Tried turning on/off my routers firewall - didn't do the trick.
 
Last edited:
In the meantime i found out how to reproduce the Error-Message "BlueJ was unable to create a virtual machine to execute projects". Turns out that my internet connection / router is causing the issue. When i cut my connection it works perfectly without any error. When i am connected elsewhere ( in this case at my university) it also works normal. Just when i'm at home and connected (with a Vodafone Easybox 803) the error pops up.


in the bluej-debuglog.txt it says:


Code:
Listening for JDWP connection on address: localhost:50319
Extra output from debug VM on launch:FATAL ERROR in native method: 
JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

Error output from debug VM on launch:ERROR: transport error 202:
 connect failed: Connection refused
ERROR: JDWP: Failed to initialize transport via localhost:50319, 
trying localhost via 127.0.0.1:50319
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
 [../../../src/share/back/debugInit.c:690]


I'm guessing that the router is somehow blocking the connection via the locahost? Dut i'm not really an expert...

Does anyone have a clue?

EDIT: Tried turning on/off my routers firewall - didn't do the trick.

Localhost, (127.0.0.1) is not related at all to your router or Internet connection. It's the local loopback address, it does not even go out to the network, the connections are purely handled in the kernel.

Check to see if anything is already binding those ports and is preventing JDWP from doing so. You can use the netstat -an command to do so, which you can pipe into grep to filter the output (netstat -an | grep 127.0.0.1 might be a good start).
 
//Connected via WiFi, BlueJ not running

localhost:~ USERNAME$ netstat -an | grep 127.0.0.1
tcp4 0 0 127.0.0.1.26164 127.0.0.1.49807 ESTABLISHED
tcp4 0 0 127.0.0.1.49807 127.0.0.1.26164 ESTABLISHED
tcp4 0 0 127.0.0.1.26164 *.* LISTEN
tcp4 0 0 127.0.0.1.631 *.* LISTEN
udp4 0 0 127.0.0.1.123 *.*

//Connected via WiFi, while trying to start bluej --> Error Message after OsX asks me several times to accept incoming connections for the bluej.app

localhost:~ USERNAME$ netstat -an | grep 127.0.0.1
tcp4 0 0 127.0.0.1.51482 127.0.0.1.51484 ESTABLISHED
tcp4 0 0 127.0.0.1.51484 127.0.0.1.51482 ESTABLISHED
tcp4 0 0 127.0.0.1.51482 127.0.0.1.51483 ESTABLISHED
tcp4 0 0 127.0.0.1.51483 127.0.0.1.51482 ESTABLISHED
tcp4 0 0 127.0.0.1.26164 127.0.0.1.49807 ESTABLISHED
tcp4 0 0 127.0.0.1.49807 127.0.0.1.26164 ESTABLISHED
tcp4 0 0 127.0.0.1.26164 *.* LISTEN
tcp4 0 0 127.0.0.1.631 *.* LISTEN
udp4 0 0 127.0.0.1.123 *.*

//NO connection via WiFi, no bluej

localhost:~ USERNAME$ netstat -an | grep 127.0.0.1
tcp4 0 0 127.0.0.1.26164 127.0.0.1.49807 ESTABLISHED
tcp4 0 0 127.0.0.1.49807 127.0.0.1.26164 ESTABLISHED
tcp4 0 0 127.0.0.1.26164 *.* LISTEN
tcp4 0 0 127.0.0.1.631 *.* LISTEN
udp4 0 0 127.0.0.1.123 *.*

//NO connection via Wifi, bluej running.


localhost:~ USERNAME$ netstat -an | grep 127.0.0.1
tcp4 0 0 127.0.0.1.51490 127.0.0.1.51491 ESTABLISHED
tcp4 0 0 127.0.0.1.51491 127.0.0.1.51490 ESTABLISHED
tcp4 0 0 127.0.0.1.26164 127.0.0.1.49807 ESTABLISHED
tcp4 0 0 127.0.0.1.49807 127.0.0.1.26164 ESTABLISHED
tcp4 0 0 127.0.0.1.26164 *.* LISTEN
tcp4 0 0 127.0.0.1.631 *.* LISTEN
udp4 0 0 127.0.0.1.123 *.*
localhost:~ USERNAME$


Not really helping, is it?
 
Nope, still does not work. Was one of the first things i tried. (Or is there another way to turn off the firewall besides turning it off in the settings menu?)

But hey, thank you for all your help and effort u put in this! I am really curious to find out what it is although if i can work around the issue.

Also, isn't it weird that it only happens when i'm connected to my wifi at home and not somewhere else?

EDIT: Turns out, it is my routers firewall. Don't know why, don't know how. But turned it off again and now everythings fine, also when i m connected.

Thx for all the help again!

Greetz
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.