My package not getting recognized at a later time.
import prasanna.AccountDetails;
import java.io.File;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import org.w3c.dom.*;
import javax.xml.parsers.*;
I have also set the classpath
C:\csj\S1>set CLASSPATH=.;
C:\Tomcat\apache-tomcat-7.0.34\lib\servlet-api.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\jsp-api.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\el-api.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\commons-beanutils-1.8.3.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\mongo-java-driver-3.1.0-20150911.172057-81.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\bson-3.0.2.jar;C:\Tomcat\apache-tomcat-7.0.34\lib\mongodb-driver-3.0.2.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\mongodb-driver-core-3.0.2.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\jstl-1.2.jar;C:\Tomcat\apache-tomcat-7.0.34\lib\jaxb-api.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\jaxb-impl.jar;C:\Tomcat\apache-tomcat-7.0.34\lib\JAXP_160.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\w3c-dom.jar;C:\Tomcat\apache-tomcat-7.0.34\lib\javax.xml.parsers-1_1.jar;
C:\Tomcat\apache-tomcat-7.0.34\lib\sax.jar;
C:\Tomcat\apache-tomcat-7.0.34\webapps\csj\WEB-INF\classes;
But still am getting the same error when I compile,
C:\Tomcat\apache-tomcat-7.0.34\webapps\csj\WEB-INF\classes>javac -d . AccountDetails.java
C:\Tomcat\apache-tomcat-7.0.34\webapps\csj\WEB-INF\classes>javac CreateAccountFinal.java
CreateAccountFinal.java:18: error: package prasanna does not exist
import prasanna.AccountDetails;
Related
We have an Android NFC Reader APP was working perfect now it has errors and the APP gets crashed.
2023-01-22 15:09:14.813 3602-3615/? E/PRM_CONFIG_Parser: get_custom_config not found
2023-01-22 15:09:14.830 4162-4351/? E/PostureManager: fail to get service
2023-01-22 15:09:14.832 4162-4351/? E/PostureManager: fail to get service
2023-01-22 15:09:14.834 4162-4351/? E/PostureManager: fail to get service
2023-01-22 15:09:14.884 12662-12662/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp.ngf132, PID: 12662
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.ngf132/com.myapp.ngf132.Nfc_reader}: java.lang.IllegalArgumentException: com.myapp.ngf132: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
i have checked multiple questions i could not figure out the issue,
These are the imports i have
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.FormatException;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.nfc.tech.Ndef;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.StrictMode;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
Any suggestions is greatly appreciated.
i needed to replace this code.
// pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_IMMUTABLE);
I got this error when I was launching my app in the emulator does anybody know whats wrong sorry I am kind of new to android studio
lib/Pages/ChattingPage.dart:15:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
But I did everything correctly it's RIGHT THERE
import 'dart:async';
import 'dart:io' as io;
import 'package:file/file.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:telegramchatapp/Widgets/FullImageWidget.dart';
import 'package:telegramchatapp/Widgets/ProgressWidget.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:html' as html;
You can not import dart:html in app for mobile (android or iOS). Remove it.
If you want use it for web application, you can use conditional import explained here.
I am using iText 7 and I am trying to set the background color of my pdf table.
Cell cell = new Cell(1, 3)
.add((IBlockElement) new Paragraph("This is a header"))
.setFont(f)
.setFontSize(13)
.setFontColor(DeviceGray.WHITE)
.setBackgroundColor(DeviceGray.BLACK)
.setTextAlignment(TextAlignment.CENTER);
But DeviceGray.WHITE and DeviceGray.BLACK give errors saying that they are not compatible. The message says that setBackgroundColor(com.itextpdf.kernel.colors.color) cannot be applied to com.itextpdf.kernel.color.DeviceGray
I also have the following imports
import com.itextpdf.io.font.constants.StandardFonts;
import com.itextpdf.kernel.color.DeviceGray;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.font.PdfFontFactory;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Cell;
import com.itextpdf.layout.element.IBlockElement;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.element.Table;
import com.itextpdf.layout.property.TextAlignment;
import com.itextpdf.layout.property.UnitValue;
I realized the cause of my problem was mixing versions of io, kernel and layout. Set all of them to 7.1.10 and it works.
I have an app. Which is in RC state. I've started finalizing works by splitting the classes to separate files with appropriate import sets at another location but suddenly I've found that cleaner version cannot read from any folder. So I investigated that if I compile the code in another location except the actual (original) app cannot read from any folder.
Strange is that from folders from those cannot be read can be obtained path (subdirectories included).
I have packed this app to executable jar file before started this works. Maybe somewhere in JVM is something stuck?
Note: New files are compiled without error. I've tried both original source and new sources.
Failure is in methods File.list() or File.listFiles(). The same using directory stream.
Used packages:
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.table.DefaultTableModel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.LineNumberReader;
import java.io.FileReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.DataInputStream;
import java.io.FilenameFilter;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.swing.UnsupportedLookAndFeelException;
For sure at this part:
private void loadFiles(){
cesta=folderPicker.getSelectedFile();
if(folder==null||loadedCesta!=cesta||(cesta==folderPicker.getSelectedFile()&vetsiPismoVisible==true)){
folder=new File(cesta.getName());
String datFiles[]=folder.list(new FilenameFilter() {
public boolean accept(File folder, String fileName) {
return fileName.endsWith(".dat");}});
If I try:
folder.canRead()
on every folder on my PC and also e.g.on my workstation these new compilations get false as a result. Variable:
folderPicker
is reffering to JFileChooser that is limited to folders and folders are obtained via actionListener of special JButton (not classic Open and Cancel). You can try it from Karolina_RC.jar from link provided in commentary under conditions said.
Problem solved. For some reason is no longer possible to use only folder name to make File type (folder). Now it is required to use path.
E.g.
File folder=new File(path.getName());
File folder=new File(path.getPath());
Former no longer working. Latter does. I am guessing some JVM-compile issue.
java.io.FileSystem is not public in java.io; cannot be accessed from outside package
This is the line the complier points to
FileSystem fs = FileSystem.get(configuration);
I don't understand why it cannot be accessed. Here are the imports
import java.io.*;
import java.io.FileSystem;
import java.nio.file.Paths;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.SequenceFile.Writer;
import org.apache.hadoop.io.*;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
import java.util.*;
import java.io.Writer;
import org.apache.hadoop.*;
wrong FileSystem object as well as the wrong Paths object. You want:
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.Path
You are dealing with the Hadoop FileSystem not the default Java implementation. Recall that you do hadoop fs -ls where fs means file system on the command line.
Replace
import java.io.FileSystem;
with
import org.apache.hadoop.fs.FileSystem;