简体   繁体   English

Eclipse在Mac上看不到/ usr / local文件夹

[英]Eclipse can't see /usr/local folder on mac

I am developing a web application in Java on my mac. 我正在Mac上用Java开发Web应用程序。 The web application will run on tomcat. 该Web应用程序将在tomcat上运行。 I have installed tomcat in /usr/local/apache-tomcat . 我已经在/usr/local/apache-tomcat安装了/usr/local/apache-tomcat

When I try to set the tomcat runtime in Server->Runtime Environments , I am not able to see the folder /usr/local . 当我尝试在“ Server->Runtime Environments设置tomcat运行Server->Runtime Environments ,看不到文件夹/usr/local how do I get eclipse to see the /usr/local/apache-tomcat directory? 如何获取Eclipse以查看/usr/local/apache-tomcat目录?

I am able to see /usr/local when using the Go to Folder option in Finder. 使用Finder中的“ Go to Folder选项时,我可以看到/usr/local

在此处输入图片说明

I had similar problem with loading external jar files in /usr/local/ for Eclipse on Mac The way i resolved this was to create a soft-link using ln -s to the folder in /usr/local to a visible folder and then loaded the jars. 我在Mac上的Eclipse中将外部jar文件加载到/ usr / local /中时遇到了类似的问题,我解决的方法是使用ln -s创建软链接到/ usr / local中的文件夹到可见文件夹,然后加载罐子。

ln -s source visible_location/link 

Works for me. 为我工作。

I just got a similar problem, and the workaround i found is to copy/paste the path of your tomcat base directory, and it works fine: 我只是遇到了类似的问题,发现的解决方法是复制/粘贴您的tomcat基本目录的路径 ,并且工作正常:

  1. Go to your tomcat base directory 转到您的tomcat基本目录
  2. pwd to get the path and copy it pwd获取路径并复制它
  3. Go to eclipse -> preferences -> servers -> runtime environments -> add button -> select apache tomcat version -> then next 转到Eclipse->首选项->服务器->运行时环境->添加按钮->选择apache tomcat版本->然后下一步
  4. At this step, instead of browsing, you can simply paste the copied path in the Tomcat installation directory field! 在此步骤中,您无需浏览,只需将复制的路径粘贴到Tomcat安装目录字段中即可!

在此处输入图片说明

et voilà

My guess is that you have your finder settings that hide hidden folders. 我的猜测是您拥有隐藏隐藏文件夹的查找程序设置。 It is possible to show them by following the instructions in this article . 可以按照本文中的说明进行显示。

The easiest way to do this is to type the following in your terminal: 最简单的方法是在终端中键入以下内容:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

If you type out the full name of the installation folder instead of using the finder, does it work? 如果您键入安装文件夹的全名而不是使用查找程序,是否可以使用?

You can easily control hidden files writing this in bash_profile 您可以轻松控制隐藏文件,将其写入bash_profile

alias hideOn='defaults write com.apple.finder AppleShowAllFiles TRUE'
alias hideOff='defaults write com.apple.finder AppleShowAllFiles FALSE'
alias kFinder='killAll Finder'
alias hOn='hideOn && kFinder'
alias hOff='hideOff && kFinder'

Then, reopen your terminal and write hOn. 然后,重新打开终端并写入hOn。 At root folder you will see hidden /usr. 在根文件夹中,您将看到隐藏的/ usr。 Just put it in your finder sidebar. 只需将其放在查找器侧边栏中即可。 Then write hOff and you will stop seeing the hidden files, but /usr will be always there at finder. 然后写hOff,您将停止看到隐藏的文件,但是/ usr将始终在finder中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM