小编www*_*139的帖子

访问限制:"应用程序"类型不是API(对所需库rt.jar的限制)

这是代码:

package mscontroller;

import javax.swing.*;
import com.apple.eawt.Application;

public class Main {
    public static void main(String[] args)
    {
        Application app = new Application();
        app.setEnabledAboutMenu(true);

        AMEListener listener = new AMEListener();
        app.addApplicationListener(listener);
        JFrame mainFrame = new JFrame("Application Menu Example");
        mainFrame.setSize(500, 500);
        mainFrame.setVisible(true);
    }
}
Run Code Online (Sandbox Code Playgroud)

这是错误:

Exception in thread "main" java.lang.Error: Unresolved compilation
problems:   Access restriction: The type 'Application' is not API
(restriction on required library
'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')
    Access restriction: The constructor 'Application()' is not API
(restriction on required library
'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')
    Access restriction: The type …
Run Code Online (Sandbox Code Playgroud)

java eclipse macos jar

164
推荐指数
12
解决办法
24万
查看次数

PHPMailer不在000webhost上工作

这段代码似乎在我的mac localhost上的Xampp中工作,但它似乎不适用于我的免费000webhost帐户.我已经尝试摆脱SSL,但它没有帮助.请记住,此程序从外部表单获取变量.

 <?php
    $subject = htmlentities($_POST['subject']);
    $email = $_POST['email'];
    $message = htmlentities($_POST['message']);




    require_once 'PHPMailer/PHPMailerAutoload.php';

    $m = new PHPMailer;

    $m->isSMTP();
    $m->SMTPAuth = true;
    //$m->SMTPDebug = 1;
    $m->Host = 'smtp.gmail.com';
    $m->Username = 'email-adress@gmail.com';
    $m->Password = 'password';
    $m->SMTPSecure = 'ssl';
    $m->Port = 465;

    $m->From = 'email-adress@gmail.com';
    $m->FromName = 'William Green';
    $m->addReplyTo('email-adress@gmail.com', 'William Green');

    //$m->addCC('email2-address@gmail.com', 'Willliam green');


    ########################################
    //email code
    //$recipient = strip_tags($_POST['mailRecipient']);
    //$name = strip_tags($_POST['recipientsName']);


    $m->addAddress($email, $email);



    //$m->Subject = strip_tags($_POST['mailSubject']);
    //$m->Body = strip_tags($_POST['mailBody']);
    $m->Subject = $subject;
    $m->Body = $message;


   //$m->AltBody = 'plain text …
Run Code Online (Sandbox Code Playgroud)

php email xampp phpmailer

2
推荐指数
1
解决办法
9310
查看次数

标签 统计

eclipse ×1

email ×1

jar ×1

java ×1

macos ×1

php ×1

phpmailer ×1

xampp ×1