Running Encryption / Decryption Application - Could Not Find Main Class

Jun 23, 2014

I am trying to put together an encryption/decryption application that will essentially accept a sentence that is submitted, and spit out the encrypted version and then switch it back to the correct sentence. I have been told to nest my information in the class (rather than the main), but am having difficulty actually understanding how to do this. The error that Eclipse is throwing me is also that it "could not find the main class." Here is my code:

import java.util.Arrays;
import java.util.Random;
public class encryptingWords {
public static void main(String[] args) {
final int ALPHASIZE = 26;
final char[] Lalpha =

[Code] .....

View Replies


ADVERTISEMENT

Using Eclipse To Maintain Java Application - Could Not Find Main Class Error

Sep 3, 2014

I currently use Eclipse to maintain our Java application. I recently upgraded from Java 6 to Java 7. I updated my Eclipse projects to use the Java 7 .jar files. I can run the application from Eclipse via the Run Configuration.

I can also run the Ant build and it completes successfully. When I install the application on my desktop, I receive the "Java Virtual Machine Launcher: Could not find main class..." error. My CLASSPATH is set to ".".

View Replies View Related

Encryption - Decryption Alphabet

Mar 8, 2014

I want to create a java program that can be encrypt-decrypt alphabet from characters . Which is the shifting of the alphabet is starting from the the first character to increase 4 and 5 increased in the second character, increasing 6 at the third character, and so on..

Then when one of the characters increasement is more than the ascii code of 'z', that character will decrease from the variable i from the loop. This is the output of the program that i want:

Encryption:
Plain text: "abcz"
Cipher text: "egiz"

Decryption:
Cipher text: "egiz"
Plain text: "abcz"

This is my code for now:
 
package -;
 public class - {
 public static void main(String[] args) {
  String enkripsi = "abcz".toLowerCase();
String dekripsi = "egiz".toLowerCase();

[Code] ....

What's wrong with my code? It won't work. Specially in the decryption.

View Replies View Related

How To Use RSA For Encryption / Decryption Of Large Files

Mar 14, 2015

I need to encrypt/decrypt file contents using RSA . But the default nature of RSA I could not upload files larger than 177 bytes for key length 1024 bytes . How it can avoid , I look it for a 100 times yet...

I attach my encryption files here ...

See attached files for more details ...

View Replies View Related

Simple Encryption / Decryption Program

Nov 1, 2014

I have to write an encryption/decryption program for a sentence entered by the user that uses arrays. Here is my code so far. I'm kind of lost on what to do next in the code.

import java.util.Scanner;

/*Program that encrypts then decrypts a sentence
Encryption
*/
public class Encryption extends java.swing.JFrame{

[code]....

View Replies View Related

Creating Encryption / Decryption Program?

Feb 25, 2015

For this week's assignment, I am supposed to create a java program that encrypt's a user's sentence, outputs the encrypted message, then decrypts the message, outputting the user's original message.

This is what I have so far. It doesn't compile the last few lines since that is not correct Java syntax.

Java Code:

import java.util.Scanner;
import java.io.*;
public class Decrypter {
public static void main(String[] args) {
String sentence;
final char REAL_ALPHA[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',

[Code] .....

So you can see I have "realAlpha" which are regular letters of the alphabet, and "codeAlpha" which are the letters I want to encrypt with. I want 'a' equal to 'z,' 'b' equal to 'y', 'c' equal to 'x' and so forth in that sort of reverse order, you know? So the word "apple" would encrypt into "zkkov."

I am stuck as to how to replace the letters in this way. You can see I tried fumbling with sentence.replace to switch the letters out between the two arrays. Also, I only barely understand arrays.

View Replies View Related

RSA Encryption Decryption Using Separate Codes With GUI

Aug 16, 2014

I am creating 2 different java codes for encryption and decryption separately based on RSA algorithm. The codes also involve swings for GUI. The problem with these codes are that my string is getting encrypted but after decrypting it,i do not get the string rather i get string of random numbers and alphabets. I am posting both the codes.

Encryption code:

import java.math.BigInteger;
import java.util.Random;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class cipher implements ActionListener

[Code] ....

Now the decryption code

import java.math.BigInteger;
import java.util.Random;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class decipher implements ActionListener

[Code] ....

The screenshots for respective codes are as attachments ....

View Replies View Related

Encryption / Decryption - How To Separate Digits To Make Numbers Encrypted

Nov 4, 2014

I've written most of the code (along with another classmate) to get this to work, but I can't seem to return the encrypted value. I'm also trying to figure out how to separate the digits (or if I'm supposed to) to make the numbers encrypted. The main kicker is that we have to be using methods to return the final values. Everything compiles, (It compiles, but no results really.)

A company wants to transmit data over the telephone, but they are concerned that their phones may be tapped. All of their data is transmitted as four-digit integers. They have asked you to write a program that will encrypt their data so that it may be transmitted more securely. Your program should read a four-digit integer number and encrypt it as follows: Replace each digit by the remainder after (the sum of that digit plus 7) is divided by 10. Then, swap the first digit with the third, and swap the second digit with the fourth. Then print the encrypted integer. Do the encryption in a method and send the encrypted number back to main.

Here are the method headers: public static int encrypt(int num) // Takes num as a parameter and returns the encrypted value public static int getnum() // gets one number from the user Example: If the user enters 1234 they should see: 0189

import java.util.Scanner; //Needed for Scanner class
public class LNFI_LNFI_program2
{
public static void main(String[] args)
{
getnum(); //Calls for getnum() method

[Code] ....

View Replies View Related

Compiling And Running Program With No Main Class / How Is That Possible

Mar 22, 2014

I made a software using Netbeans and javaswing. Accidently i deleted my main file which contains my main class and main method. Just to test, i tried to compile and run and it worked but the style of my buttons and windows has changed. So, what happened? How can i change the style of my programs?

//File Accidently deleted
package time;
public class Time {
public static void main( String[] args ) {
Window wdow = new Window();
wdow.setVisible( true );
}
}

View Replies View Related

JDK 1.6 - Could Not Find Or Load Main Class

Sep 23, 2014

I have permanently set the path of bin of JDK 1.6 in the environment variables of my system. I am able to compile any of my java programs successfully. But when I give command to run the program I am getting an error "could not find or load main class".

When I write the command "set classpath=.;" program runs successfully. I want to know whether I have to set this classpath everytime I run a new progaram. Is there any permanent way to set classpath ?

View Replies View Related

Could Not Find Or Load Main Class

Mar 1, 2015

I creates this simple code (shown below) inside a package of a major opensource code (i.e., openSHA), but when i run it the following error appears. The error mentions a class named "KT_testGmpeForScenarioRupture" that i wrote before and did not run showing exactly the same error.

Code:

package org.opensha.sha.gcim.imr.attenRelImpl;
public class KT_Test {
private static void main(String args) {
int x=4;
System.out.println("x is " + x);
}
}

Error: Could not find or load main class org.opensha.sha.gcim.imr.attenRelImpl.KT_testGmpeF orScenarioRupture

View Replies View Related

Cannot Find Or Load Main Class

Nov 19, 2014

I am using Netbeans as my IDE and I have created a program called Saluton.java

I navigate to the folder holding the class file using the command line under Windows 7 but when I issue the command java Saluton.class I get an error it cannot load or find the main class.

View Replies View Related

Error Could Not Find Or Run Main Class

Jan 7, 2014

I made a breakout like game that runs as a applet and now i wanted to make it run in a jframe so i wrote this

Java Code:

import java.applet.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
public class BrickBuster{
public static void main(String[] args){
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
JApplet BrickBuster = new JApplet();
frame.add(BrickBuster);
BrickBuster.init();
}
} mh_sh_highlight_all('java');

It compiles fine but whenever i try running it with the java command it says it couldnt find or load main class. also i have it save in a folder called BrickBuster so i called java BrickBusterBrickBuster.class

View Replies View Related

Could Not Find Or Load Main Class In CMD

Sep 23, 2014

I tried running my program on cmd but it produces the error "could not find or load main class" ...It compiles well but it just doesn't run. Here is my code:

package writedoc;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.IOException;
public class WriteDoc {
public static void main(String[] args) throws IOException {
String strDocument="grades.txt";

[Code] ....

View Replies View Related

JavaDigest - Could Not Find Or Load Main Class

Nov 15, 2014

Could not find or load the main class.

package in.javadigest.encryption;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.KeyPair;

[Code] ....

Its compiling the compiled class is in C:programsclass folder. Iam running the program using the following commands...

javac MainClass2.java // This is working fine
java -cp C:programsclass MainClass2

View Replies View Related

Could Not Find Or Load Main Class Error

Sep 13, 2014

I have a problem that happens randomly where i try to compile and it just comes up with error

"Error: Could not find or load main class com.productiontrackingscreens.rexam.EmployeeAddressList"

This is a program that worked fine until i started it today. Seems a bug with eclipse.

View Replies View Related

Error - Could Not Find Or Load Main Class

Sep 30, 2014

I'm trying to run a java program from cmd. I'm using Windows 8, java version "1.8_0_20". I've got two classes, the main class called Middleware and a secondary class, called WorkerThread, of which the main class is using functions. I've successfully compiled both .java files with javac, and created the .class file. So all files are in the same folder. However, when I attempt to run the main class with java Middleware, I get the error message: "Error: Could not find or load main class". Here's the main class:

package middleware;
import java.net.*;
import java.util.concurrent.*;
public class Middleware {
//Number of threads serving clients.
private static int nr_threads = 5;
private static int portNr = 6789;
private static ServerSocket welcomeSocket;
private static ExecutorService executor;

[code]....

My code compiles and runs fine in eclipse but on the console, I'm having troubles.

View Replies View Related

Could Not Find Main Class - Program Will Exit

Jan 24, 2015

This is my first java program,i am using eclipse IDE-----

package day1.example;

public class MyFirstJava {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("hi");
}
}

When i saved it,it shows no error.when i run it then a pop-up says "could not find the main class.the program will exit" and in the console it says---

java.lang.UnsupportedClassVersionError: day1/example/MyFirstJava : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)

[Code] ......

View Replies View Related

Stuck On Error - Could Not Find Or Load Main Class

Sep 2, 2014

I'm getting an error trying to run a welcome app from a book. I've looked at the FAQs and can't seem to solve the issue. I'm guessing my path and/or classpath are not right. Here's my path environment variable.

C:jdk1.8.0_20in;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerSh

[Code] ....

Here's my output.

09/01/2014 10:23 PM 634 Welcome.class
09/01/2014 10:21 PM 422 Welcome.java
14 File(s) 126,243,703 bytes
9 Dir(s) 53,942,079,488 bytes free

[Code] .....

It looks like the version command gives me what it should, so it appears I've got java setup right, but I"m stuck on the error I'm getting :

C:jdk1.8.0_20>javac -version
javac 1.8.0_20
C:jdk1.8.0_20>

View Replies View Related

Error - Could Not Find Or Load Main Class GameTester

Oct 29, 2014

I was trying to write my own version of the game SimpleDotCom from Head First Java. I have two files:

Game.java:
package project_01;
public class Game{
byte hitCount = 0;
String result = "miss";
int counter = 0;
String checkGuess(int[] location,int userGuess){

[Code] .....

The two files are in the same directory, "project_01" and the CLASSPATH environment variable is set to ".;".
The game compiled but when I tried launching it with "java GameTester" it returned the error : Could not find or load main class GameTester. I know my game is horrible and probably extremely buggy but I'll fix all the bugs, etc. later, right now I just need to get it to run.

View Replies View Related

Error / Could Not Find Or Load Main Class HelloWorld

Jan 8, 2015

My problem is that I can compile a java HelloWorld program using javac HelloWorld.java but I cannot run the program using java HelloWorld. I didn't create the code it was developed by a professional programmer. My assignment is to compile and run, so that I see the output.

View Replies View Related

Could Not Find Or Load Main Class HelloWorld - Notepad++

Dec 11, 2014

I'm new to this java stuff and when I go to notepad++ and this keeps coming up when I try to compile it: "Error: Could not find or load main class HelloWorld" what it means...

View Replies View Related

Declaring Enums - Could Not Find Or Load Main Class

Feb 25, 2014

I've just started, so right now I'm reading about declaring enums, the book lists the following code

enum CoffeeSize {
//8,10 & 16 are passed to the constuctor
BIG(6), HUGE(10), OVERWHELMING(16);
CoffeeSize(int ounces){ //constructor
this.ounces = ounces;

[Code] .....

I'm assuming that code to be in a same file since enums can be declared within and outside a class, so I saved it into a file named "Coffee.java", it compiles just fine from command line but when I try to execute "java Coffee" it throws "Error: Could not find or load main class Coffee"...

View Replies View Related

Using Java From DOS Command Line - Cannot Find Or Load Main Class

Nov 10, 2013

When I try to run Java from the Windows DOS command line, I'm running into trouble:
 
1. When I run Java from the wrong directory, I get the error Error: cannot find or load main class myapp1.
 
2. When I get to the "right" directory (.../MyApp1/build/classes/myapp1/, which is where the MyApp1.class file resides), I get the following error:
 
Exception in thread "main" java.lang.NoClassDefFoundError: MyApp1 (wrong name: myapp1/MyApp1)
 
1. The CLASSPATH variable is not set (when I type echo %CLASSPATH% the system returns %CLASSPATH%).

2. I also get the same error above when I use: > java -cp . myapp1

3. I've made sure the PATH is set correctly in environment variables, with the Java path at the beginning of the path string).

View Replies View Related

Running Hello World Application

Apr 1, 2014

I have a problem with running my hello world aplication. Here is the code.

public class HelloWorld {
public static void mаin(String[] args) {
System.out.println("Hello world!");
}
}

It compiles fine. But I get an exception when I try to run it.Here is the error message I'm getting:

Exception in thread "main" java.lang.NoSuchMethodException: HelloWorld.main([Ljava.lang.String;)
at java.lang.Class.getMethod(Class.java:1605)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)

Process finished with exit code 1

View Replies View Related

Web Services :: Exception While Running Web Application

Apr 15, 2015

I am integrating Struts hibernate tiles and spring configuration project. While running give me exception as

Apr 15, 2015 7:16:10 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:Program FilesJavajre1.8.0_40in;C:WindowsSunJavain;C:Windowssystem32;C:Windows;C:/Program Files/Java/jre1.8.0_40/bin/server;C:/Program Files/Java/jre1.8.0_40/bin;C:/Program Files/Java/jre1.8.0_40/lib/amd64;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesMySQLMySQL Server

[code]....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved