Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7730653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:16:46+00:00 2026-06-01T06:16:46+00:00

I am running Jconsole on my macbook and trying to connect to a linux

  • 0

I am running Jconsole on my macbook and trying to connect to a linux terminal on ec2 that does not have graphics(only command line access).

I run my code like this:

java -jar program.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9005 
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.remote.ssl=false

I read here that there was a problem with accessing via EC2(after I had problems connecting) and the solution seemed to be ‘java.rmi.server.hostname to the public hostname of the instance‘

I’m a bit confused at how to do this. I have tried two things, one to put it directly in my code(in the void static main section):

System.setProperty( "java.rmi.server.hostname" , "external_EC2_address" ); //in my real code I have the correct address here

The system accepted it(no errors when I created/uploaded runnable jar). I also opened the firewall on my instance to allow all TCP traffic. No Luck. I tried the above statement also as a flag to launch to the program but still no luck.

Any ideas how do this?

UPDATE: This will show how green I am at Java, I got a step further(still doesn’t work) but I realized putting the java -jar filename.jar and then the options didn’t give me the same results as putting my -jar at the end of the command. I tried that and the program tries to connect and then says connection failed(before it would just say it at the login screen right away).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:16:47+00:00Added an answer on June 1, 2026 at 6:16 am

    Set the hostname property before the VM starts:

    java -Dcom.sun.management.jmxremote \
         -Dcom.sun.management.jmxremote.port=9005 \
         -Dcom.sun.management.jmxremote.authenticate=false \
         -Dcom.sun.management.remote.ssl=false \
         -Djava.rmi.server.hostname=the.public.ip \
         -jar program.jar
    

    Add the relevant rules to your security group.

    Finally, ensure iptables is stopped, as this could be the reason that you’re not getting a connection from the outside world. As root (or using sudo …):

    # service iptables stop
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java process running on a Linux box, but it cannot be
I've been trying to monitor a locally running Tomcat via JConsole. I, of course,
I'm running a multithreaded java app in Linux RedHat 5.3 on a machine that
Running into a problem. I have a table defined to hold the values of
Running the command generates new rails projects: $ rails generate controller home index The
I've got a Red Hat box with 6G memory running Tomcat and I'm trying
I have a JFrame that accepts top-level drops of files. However after a drop
running Linux ubuntu 3.0.0-15-generic #26-Ubuntu SMP Fri Jan 20 17:23:00 UTC 2012 x86_64 x86_64
I'm trying to open a JMX connection to java application running on a remote
I'm trying to dynamically load the phonegap javascript file (so that I can choose

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.