Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Kadiem Haider
Greenhorn
+ Follow
4
Posts
1
Threads
0
Cows
since Jul 22, 2017
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Number Posts (4/100)
Number Threads Started (1/100)
Number Cows Received (0/5)
Number Likes Received (0/10)
Number Likes Granted (0/20)
Set bumper stickers in profile (0/3)
Report a post to the moderators (0/1)
Edit a wiki page (0/1)
Create a post with an image (0/2)
Greenhorn Scavenger Hunt
First Post
Number Posts (4/10)
Number Threads Started (1/10)
Number Likes Received (0/3)
Number Likes Granted (0/3)
Set bumper stickers in profile (0/1)
Set signature in profile
Search for a post/thread (0/3)
Set a watch on a thread
Save thread as a bookmark
Create a post with an image (0/1)
Recent posts by Kadiem Haider
How to grant permission
i changed it to "C:\\Users\\hp\\Desktop\\Bot\\Scripts\\javamail-1.4.7\\Email.jar"
anyway forget about remotely word, the problem is in this part
try { Email(null); } catch (IOException e) { e.printStackTrace(); }
it gives me this error
Blocked permission: ("java.io.FilePermission" "<<ALL FILES>>" "execute")
show more
6 years ago
Java in General
How to grant permission
Chatter is the the main class:
package Chatter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.attribute.PosixFilePermission; import java.security.AccessController; import java.security.Permission; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.HashSet; import java.util.List; import java.util.Set; import org.osbot.rs07.api.ui.Message; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; public class Chatter extends Script{ private Dialogue Dialogue; boolean said; int Index; public int onLoop() throws InterruptedException { if(said == true){ sleep(random(2000,4500)); Dialogue = new Dialogue(); List<String> RespondSpeach = Dialogue.getNumberList1(); keyboard.typeString(RespondSpeach.get(Index) , true); try { Email(null); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } said = false; } return 500; } public void onMessage(Message m) throws InterruptedException { Dialogue = new Dialogue(); List<String> ReceivedSpeach = Dialogue.getNumberList(); for (String word : ReceivedSpeach){ if (m.getMessage().contains(word)){ Index = ReceivedSpeach.indexOf(word); said = true; } } } public static void Email(String[] args) throws IOException { ProcessBuilder pb = new ProcessBuilder("java", "-jar", "C:\\Users\\hp\\Desktop\\Bot\\Scripts\\javamail-1.4.7\\Email.jar"); Process p = pb.start(); } }
the problem happens when the
boolean said
is
true
and the keyboard wrote the string the part that comes after
try { Email(null); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
causes me this issue :
Blocked permission: ("java.io.FilePermission" "<<ALL FILES>>" "execute")
show more
6 years ago
Java in General
How to grant permission
ok so if run this class alone as a java application in eclipse
public static void Email(String[] args) throws IOException { ProcessBuilder pb = new ProcessBuilder("java", "-jar", "C:\\Email.jar"); Process p = pb.start(); }
it run's without any problem, but the problem is when i try to run this code remotely like here:
try { Chatter.Email(null); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
i get this message:
Blocked permission: ("java.io.FilePermission" "<<ALL FILES>>" "execute")
show more
6 years ago
Java in General
How to grant permission
i want to run this code
public static void Email(String[] args) throws IOException { ProcessBuilder pb = new ProcessBuilder("java", "-jar", "C:\\Email.jar"); Process p = pb.start(); }
but im getting this error
Blocked permission: ("java.io.FilePermission" "<<ALL FILES>>" "execute")
i tried using this but no use
public static void Perm(String[] args) throws IOException { File file = new File("/Users/hp/temp.txt"); //set application user permissions to 455 file.setExecutable(false); file.setReadable(false); file.setWritable(true); //change permission to 777 for all the users //no option for group and others file.setExecutable(true, false); file.setReadable(true, false); file.setWritable(true, false); //using PosixFilePermission to set file permissions 777 Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>(); //add owners permission perms.add(PosixFilePermission.OWNER_READ); perms.add(PosixFilePermission.OWNER_WRITE); perms.add(PosixFilePermission.OWNER_EXECUTE); //add group permissions perms.add(PosixFilePermission.GROUP_READ); perms.add(PosixFilePermission.GROUP_WRITE); perms.add(PosixFilePermission.GROUP_EXECUTE); //add others permissions perms.add(PosixFilePermission.OTHERS_READ); perms.add(PosixFilePermission.OTHERS_WRITE); perms.add(PosixFilePermission.OTHERS_EXECUTE); Files.setPosixFilePermissions(Paths.get("C:\\Email.jar"), perms); }
show more
6 years ago
Java in General