加载启动文件

时间:2018-08-31 21:31:53

标签: java linux bash shell path

我的Linux终端不断给我错误:找不到Java命令。我在网上找到了这些说明,并试图逐步遵循它们:

打击壳

  1. 编辑启动文件(〜/ .bashrc)
  2. 修改PATH变量

    PATH=/usr/local/jdk1.8.0/bin:$PATH 
    export PATH
    
  3. 保存并关闭文件

  4. 加载启动文件

    % . /.profile
    
  5. 通过重复java命令验证是否已设置路径

    % java -version
    

我所做的事情: 我已经编辑了.bashrc文件

问题

我似乎无法使用加载启动文件。 /.profile命令。 这是我尝试显示的内容:

➤ . /.profile
bash: /.profile: No such file or directory

我还尝试直接检查它是否解决了问题,但没有解决问题:

 ➤ java -version
bash: java: command not found

2 个答案:

答案 0 :(得分:0)

Debian带有一个默认 'This creates a "worksheet loop" that will automatically cycle through each page of the workbook and apply the macro thereto. Dim sheets As Worksheet For Each sheets In ThisWorkbook.Worksheets sheets.Activate 'The proceeding lines create the column headings, as well as the headings horizontal headings used to show the greatest and least perchange change as well as the greatest total volume. Range("I1").Value = "Ticker" Range("J1").Value = "Yearly Change" Range("K1").Value = "Percent Change" Range("L1").Value = "Total Stock Volume" Range("P1").Value = "Ticker" Range("Q1").Value = "Value" Range("O2").Value = "Greatest % Increase" Range("O3").Value = "Greatest % Decrease" Range("O4").Value = "Greatest Total Volume" Range("O5").Value = "Least Total Volume" 'This creates a variable which will identify and label the stock ticker. Dim stock_ticker As String 'This creates a variable which will hold the total stock volume. Dim stock_volume As Double stock_volume = 0 'This variable is used to input the ticker value in the correct cell in column I. The ticker changes at a faster rate in column I than in column A. This variable is therefore used to adjust the rate tickers are copied over from column A to column I. Dim j As Integer j = 2 'This loop checks to see if the value in cell 'Ax" is equal to "Ay", where x and y are integers, and y=x+1. If they are equal, Excel will recognize the tickers as being the same, and add the stock volume in the xth row to an accumlative total stock volume. If Ax does not equal Ay, Excel will recognize that the ticker just changed. When this happens, Excel will will add the last stock volume for the current ticker to the accumlative total stock volume; then it will identify what the current ticker is and insert this into column I, insert the total stock volume for that ticker into column L, then reset the total stock volume back to 0, then repeat the process. For i = 2 To 43398 If Cells(i, 1).Value = Cells(i + 1, 1).Value Then stock_volume = stock_volume + Cells(i, 7).Value ElseIf Cells(i, 1).Value <> Cells(i + 1, 1).Value Then stock_volume = stock_volume + Cells(i, 7).Value Cells(j, 9).Value = Cells(i, 1).Value Cells(j, 12).Value = stock_volume j = j + 1 stock_volume = 0 End If Next i Dim stock_year_start As Double Dim stock_year_end As Double Dim stock_year_change As Double Dim stock_percent_change Dim k As Integer k = 2 For i = 2 To 43398 If Right(Cells(i, 2), 4) = "0101" Then stock_year_start = Cells(i, 3) ElseIf Right(Cells(i, 2), 4) = "1231" Then stock_year_end = Cells(i, 6) stock_year_change = stock_year_end - stock_year_start stock_percent_change = stock_year_change / stock_year_start Cells(k, 10).Value = stock_year_change If Cells(k, 10).Value > 0 Then Cells(k, 10).Interior.ColorIndex = 4 ElseIf Cells(k, 10).Value < 0 Then Cells(k, 10).Interior.ColorIndex = 3 End If Cells(k, 11).Value = stock_percent_change k = k + 1 End If Next i Range("K1").EntireColumn.NumberFormat = "0.00%" 'The proceeding lines automatically resize the cells created throughout the program to fit the content therein. Dim sheet_name As String sheet_name = ActiveSheet.Name Worksheets(sheet_name).Columns("I:L").AutoFit Worksheets(sheet_name).Columns("O:Q").AutoFit 'This cycles to the next page in the workbook and repeats all the code hitherto. Next sheets End Sub ,该默认源~/.profile。作者没有意识到这不是普遍的事情。此外,您还删除了前导~/.bashrc和空格。

相反,只需直接来源.

.bashrc

答案 1 :(得分:0)

这两个都允许linux之类的事情发生。或使用本地计算机上随附的实用程序。您可能可以使用Windows的Bash来执行此操作。这是一种获取linux vm的简单方法,但是我在使用之间持久设置存在问题。请参阅VirtualBox或HyperVmanager下载linux ISO并进行实际操作。

相关问题