Reputation: 12431
I just get started to use a MacBook Pro Mid 2012 Release
and trying to develop with IntelliJ
. I use Tomcat 8
server for the deployment.
While I run the Tomcat
, I get the following,
This 1099 comes from the JMX port
in Run -> Edit Configurations
. However, if I changed it to other port (say, 1098)
doesn't help either.
I had this info as the output
,
/Applications/Tomcat-8.5.15/bin/catalina.sh run
/Applications/Tomcat-8.5.15/bin/catalina.sh: line 366: /Applications/IntelliJ IDEA.app/Contents/bin/java: No such file or directory
Disconnected from server
/Applications/Tomcat-8.5.15/bin/catalina.sh: line 366: exec: /Applications/IntelliJ IDEA.app/Contents/bin/java: cannot execute: No such file or directory
Java related info,
$ which java
/usr/bin/java
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Project SDK
was provided IntelliJ IDEA IU-171.4694.23
, but, tried with the 1.8
as well. No success with both of the SDK
s.
I TOOK TO FOLLOWING STEPS SO FAR WITH NO SUCCESS, —————————————————————————————
catalina.sh
,Initially, I didn't have the permission to run the Tomcat
and compiled the catalina.sh
after entering the /bin
folder inside the Tomcat
directory with the command,
$ chmod a+x catalina.sh
hostname
in the /etc/hosts
file,I get the hostname from the terminal
,
$ hostname
macbook-pro
/etc/hosts
returns the following (Sublime)
,
$ subl /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
Inserted the macbook-pro
information with the localhost,
127.0.0.1 localhost macbook-pro
Tried to kill the process (which I had success with MacBook Air
earlier),
$ ps -A | grep intellij
$ ps -A | grep 1099
Every time get the different process info and could not kill
the process.
What to do to solve the issue?
Update
I created a new project with the IntelliJ
and now it runs fine with Tomcat
. The previous project along with the IdeaProjects
directory was imported from the other MacBook Air
and pasted in the base
directory. Though, I'm still unable to understand why that would be an issue.
My project is so far small (LOC < 1000 with 7 sources .java
file). So, I'm manually creating the files and pasting the code inside from the main project. I will up for the REAL
solution though.
Upvotes: 2
Views: 12004
Reputation: 2904
In my case I used ;
as separator in VM options in mac os. I added \
to it and error disappeared:
-Dsome.props=prop1\;prop2\;prop3
Upvotes: 1
Reputation: 21
Check if your Tomcat contains the file setenv.sh
([YOUR_CATALINA_HOME]/bin/setenv.sh
) or check catalina.sh
; it may redefine the CATALINA_OPTS
/ JAVA_OPTS
variable that IntelliJ uses to set up JMX. Your JMX port config (*-Dcom.sun.management.jmxremote.port*
) in the file (setenv.sh
/ catalina.sh
) should be the same as in IntelliJ:
CATALINA_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1 ${CATALINA_OPTS}"
Upvotes: 2
Reputation: 792
Similar case - just because forgot to add by mistake -D before VM options configuration, i.e:
Instead of DB_USER=User should be -DDB_USER=User
Foolish mistake :)
Upvotes: 2
Reputation: 66
I was also facing similar issue, For me the issue was related to invalid VM Options configuration in Intellij In Intellij Click on Run > Edit Configuration Server Tab You will notice VM Options My VM Options were -Dflyway.enabled=false -Dquratz.cron=0 0 2 1/1 * ?
When I removed -Dquratz.cron=0 0 2 1/1 * ? Intellij started the server again and the above issue was resolved , Looks like you cannot pass special characthers in VM Options
Upvotes: 5